diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceipt.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceipt.json index 8db7ac356f97..e4d24bbdc704 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceipt.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceipt.json @@ -22,7 +22,7 @@ "useSchemePrefix": false, "parameters": [ { - "$ref": "FormRecognizerReceiptOcr.json#/parameters/Endpoint" + "$ref": "#/parameters/Endpoint" } ] }, @@ -32,11 +32,12 @@ "paths": { "/prebuilt/receipt/asyncBatchAnalyze": { "post": { - "description": "Batch Read Receipt operation. The response contains a field called 'Operation-Location', which contains the URL that you must use for your 'Get Read Receipt Result' operation.", - "operationId": "BatchReadReceipt", + "description": "Extract field text and semantic values from a given receipt document.", + "operationId": "AnalyzeReceipt", + "summary": "Analyze Receipt", "parameters": [ { - "$ref": "FormRecognizerReceiptOcr.json#/parameters/ImageUrl" + "$ref": "#/parameters/ImageUrl" } ], "consumes": [ @@ -47,37 +48,76 @@ ], "responses": { "202": { - "description": "The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in this header. The 'Operation-Location' URL will expire in 48 hours.", + "description": "The service has accepted the request for processing. The client can query the operation status and retrieve the analysis result using the 'Operation-Location' URL header specified in the response. Note that the 'Operation-Location' URL expires in 48 hours.\n
Operation-LocationURL to query and retrieve the analysis result. This URL expires in 48 hours.\n
\nExample: https://cognitiveservice/formrecognizer/v1.0-preview/prebuilt/receipt/operations/54f0b076-4e38-43e5-81bd-b85b8835fdfb
", "headers": { "Operation-Location": { - "description": "URL to query for status of the operation. The URL will expire in 48 hours. ", - "type": "string" + "type": "string", + "description": "URL to query and retrieve the analysis result. This URL expires in 48 hours." } } }, - "default": { - "description": "Error response.", - "schema": { - "$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError" + "400": { + "description": "Bad request error. Detailed error code and message are specified in the JSON response:\n
Error CodeDescription
BadArgumentBad or unrecognizable request JSON or binary file.
InvalidImageURLImage URL is badly formatted.
FailedToDownloadImageFailed to download image from input URL.
InvalidImageThe input data is not a valid image or password protected.
UnsupportedImageFormatImage format unsupported. Supported formats include JPEG, PNG, BMP, PDF and TIFF.
InvalidImageSizeThe input image is too large. It should not be larger than 20MB.
InvalidImageDimensionThe input image dimension is out of range. The minimum image dimension is 50 x 50 pixels and the maximum is 10000 x 10000 pixels. The maximum PDF dimension is 17 x 17 inches.
", + "examples": { + "application/json": { + "error": { + "code": "BadArgument", + "message": "Invalid input." + } + } + } + }, + "415": { + "description": "Unsupported media type error. 'Content-Type' does not match the POST content.\n
  • For image URL, 'Content-Type' should be application/json.
  • For binary image data, 'Content-Type' should be application/octet-stream.

  • ", + "examples": { + "application/json": { + "error": { + "code": "BadArgument", + "message": "Unsupported media type." + } + } + } + }, + "500": { + "description": "Internal server error.", + "examples": { + "application/json": { + "error": { + "code": "Unspecified", + "message": "Internal server error." + } + } + } + }, + "503": { + "description": "Transient fault while querying Windows Azure storage services.", + "examples": { + "application/json": { + "error": { + "code": "StorageException", + "message": "Transient fault occurred while querying Windows Azure storage services. Please try again later." + } + } } } }, "x-ms-examples": { - "Successful 'Batch Read Receipt' request": { - "$ref": "./examples/SuccessfulBatchReadReceiptWithUrl.json" + "Successful 'Analyze Receipt' request": { + "$ref": "./examples/SuccessfulAnalyzeReceiptWithUrl.json" } } } }, "/prebuilt/receipt/operations/{operationId}": { "get": { - "description": "This interface is used for getting the analysis results of a 'Batch Read Receipt' operation. The URL to this interface should be retrieved from the 'Operation-Location' field returned from the 'Batch Read Receipt' operation.", - "operationId": "GetReadReceiptResult", + "description": "Query the status and retrieve the result of an 'Analyze Receipt' operation. The URL to this interface can be obtained from the 'Operation-Location' header in the 'Analyze Receipt' response.", + "operationId": "GetReceiptResult", + "summary": "Get Receipt Result", "parameters": [ { "name": "operationId", "in": "path", - "description": "Id of read operation returned in the response of a 'Batch Read Receipt' operation.", + "description": "Id returned by the 'Analyze Receipt' operation.", "required": true, "type": "string" } @@ -87,21 +127,51 @@ ], "responses": { "200": { - "description": "Returns the read operation status.", + "description": "JSON fields in the response body:
    FieldTypeDescription
    statusString'Analyze Receipt' operation status. Possible values:
    • NotStarted: The receipt analysis process has not started.
    • Running: The receipt is being analyzed.
    • Failed: The receipt analysis process has failed.
    • Succeeded: The receipt analysis process has succeeded.
    If the status is Succeeded, the response JSON will include the receipt understanding and text recognition results. The receipt understanding result is organized as a dictionary of named field values, where each value contains the extracted text, normalized value, and corresponding OCR word elements. The text recognition result is organized as a hierarchy of Lines and Words, with text, bounding box and confidence information.
    recognitionResults[Object]An array of objects, each representing the OCR result for a page in the input document.
    understandingResults[Object]An array of objects, each representing a receipt detected in the input document.
    pages[Integer]List of pages where the receipt is found. Currently, only single-page receipts are supported.
    fieldsObjectDictionary of analyzed field values. If a field is not detected, the corresponding field value will be set to null.
    valueTypeStringData type of the field value. Currently, possible types include \\\"stringValue\\\" and \\\"numberValue\\\".
    valueString/NumberSemantic value of the recognized field. If the text value cannot be converted, value will be set to \"\" for stringValue or null for numberValue.
    textStringExtracted field text in understandingResults, or a recognized word/line in recognitionResults.
    elements[Object]List of references to OCR words comprising the detected field value.
    $refStringJSON pointer to an OCR word element. For example, \"#/recognitionResults/0/lines/1/words/2\" refers to 3rd word in the 2nd line of the 1st page in the document.
    lines[Object]An array of objects, each representing a line of recognized text. The maximum number of lines returned is 300 per page.
    The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.
    words[Object]An array of objects, each representing a recognized word.
    boundingBox[Number]The bounding box of a recognized line or word, depending on the parent object. It is represented by an array of eight numbers corresponding to four points, clockwise from the top-left corner. For image, the (x, y) coordinates are measured in pixels from the top-left corner of the image. For PDF, the (x, y) coordinates are measured in inches from the top-left corner of the each page.
    confidenceStringThis flag appears when the recognition of a word is of low confidence.
    widthNumberThe width of the image/PDF in pixels/inches, respectively.
    heightNumberThe height of the image/PDF in pixels/inches, respectively.
    clockwiseOrientationNumberThe orientation of the image in clockwise direction, measured in degrees between [0, 360).
    pageIntegerThe 1-based page number of the recognition result.
    unitStringThe unit used by the width, height and boundingBox properties. For images, the unit is \"pixel\". For PDF, the unit is \"inch\".
    ", "schema": { - "$ref": "#/definitions/readReceiptResult" + "$ref": "#/definitions/analyzeReceiptResult" + }, + "examples": { + "application/json": "{\n \"status\": \"Succeeded\",\n \"recognitionResults\": [\n {\n \"page\": 1,\n \"clockwiseOrientation\": 1.28,\n \"width\": 3024,\n \"height\": 4032,\n \"unit\": \"pixel\",\n \"lines\": [\n {\n \"boundingBox\": [\n 772,\n 506,\n 1773,\n 517,\n 1771,\n 732,\n 769,\n 721\n ],\n \"text\": \"Walmart\",\n \"words\": [\n {\n \"boundingBox\": [\n 786,\n 515,\n 1766,\n 517,\n 1768,\n 736,\n 793,\n 720\n ],\n \"text\": \"Walmart\"\n }\n ]\n },\n ...\n ]\n }\n ],\n \"understandingResults\": [\n {\n \"pages\": [\n 1\n ],\n \"fields\": {\n \"MerchantName\": {\n \"valueType\": \"stringValue\",\n \"value\": \"Walmart\",\n \"text\": \"Walmart\",\n \"elements\": [\n {\n \"$ref\": \"#/recognitionResults/0/lines/0/words/0\"\n }\n ]\n },\n \"MerchantPhoneNumber\": {\n \"valueType\": \"stringValue\",\n \"value\": \"+13605710300\",\n \"text\": \"( 360 ) 571 - 0300\",\n \"elements\": [\n {\n \"$ref\": \"#/recognitionResults/0/lines/2/words/0\"\n },\n {\n \"$ref\": \"#/recognitionResults/0/lines/2/words/1\"\n },\n {\n \"$ref\": \"#/recognitionResults/0/lines/2/words/2\"\n },\n {\n \"$ref\": \"#/recognitionResults/0/lines/2/words/3\"\n },\n {\n \"$ref\": \"#/recognitionResults/0/lines/2/words/4\"\n },\n {\n \"$ref\": \"#/recognitionResults/0/lines/2/words/5\"\n }\n ]\n },\n \"TransactionDate\": {\n \"valueType\": \"stringValue\",\n \"value\": \"2012-03-06\",\n \"text\": \"03/06/12\",\n \"elements\": [\n {\n \"$ref\": \"#/recognitionResults/0/lines/31/words/0\"\n }\n ]\n },\n \"Total\": {\n \"valueType\": \"numberValue\",\n \"value\": 18.33,\n \"text\": \"18.33\",\n \"elements\": [\n {\n \"$ref\": \"#/recognitionResults/0/lines/18/words/0\"\n }\n ]\n },\n ...\n }\n }\n ]\n}" } }, - "default": { - "description": "Error response.", - "schema": { - "$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError" + "404": { + "description": "Invalid or expired operation ID.", + "examples": { + "application/json": { + "error": { + "code": "BadArgument", + "message": "Operation ID is invalid or expired." + } + } + } + }, + "500": { + "description": "Internal server error.", + "examples": { + "application/json": { + "error": { + "code": "Unspecified", + "message": "Internal server error." + } + } + } + }, + "503": { + "description": "Transient fault while querying Windows Azure storage services.", + "examples": { + "application/json": { + "error": { + "code": "StorageException", + "message": "Transient fault occurred while querying Windows Azure storage services. Please try again later." + } + } } } }, "x-ms-examples": { - "Successful 'Get Read Receipt Result' request": { - "$ref": "./examples/SuccessfulReadReceiptResult.json" + "Successful 'Get Receipt Result' request": { + "$ref": "./examples/SuccessfulGetReceiptResult.json" } } } @@ -110,11 +180,12 @@ "x-ms-paths": { "/prebuilt/receipt/asyncBatchAnalyze?overload=stream": { "post": { - "description": "Read Receipt operation. When you use the 'Batch Read Receipt' interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'Get Read Receipt Result' operation.", - "operationId": "BatchReadReceiptInStream", + "description": "Extract field text and semantic values from a given receipt document.", + "operationId": "AnalyzeReceiptInStream", + "summary": "Analyze Receipt", "parameters": [ { - "$ref": "FormRecognizerReceiptOcr.json#/parameters/ImageStream" + "$ref": "#/parameters/ImageStream" } ], "consumes": [ @@ -125,47 +196,205 @@ ], "responses": { "202": { - "description": "The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in this header. The 'Operation-Location' URL will expire in 48 hours.", + "description": "The service has accepted the request for processing. The client can query the operation status and retrieve the analysis result using the 'Operation-Location' URL header specified in the response. Note that the 'Operation-Location' URL expires in 48 hours.\n
    Operation-LocationURL to query and retrieve the analysis result. This URL expires in 48 hours.\n
    \nExample: https://cognitiveservice/formrecognizer/v1.0-preview/prebuilt/receipt/operations/54f0b076-4e38-43e5-81bd-b85b8835fdfb
    ", "headers": { "Operation-Location": { - "description": "URL to query for status of the operation. The URL will expire in 48 hours. ", - "type": "string" + "type": "string", + "description": "URL to query and retrieve the analysis result. This URL expires in 48 hours." } } }, - "default": { - "description": "Error response.", - "schema": { - "$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError" + "400": { + "description": "Bad request error. Detailed error code and message are specified in the JSON response:\n
    Error CodeDescription
    BadArgumentBad or unrecognizable request JSON or binary file.
    InvalidImageURLImage URL is badly formatted.
    FailedToDownloadImageFailed to download image from input URL.
    InvalidImageThe input data is not a valid image or password protected.
    UnsupportedImageFormatImage format unsupported. Supported formats include JPEG, PNG, BMP, PDF and TIFF.
    InvalidImageSizeThe input image is too large. It should not be larger than 20MB.
    InvalidImageDimensionThe input image dimension is out of range. The minimum image dimension is 50 x 50 pixels and the maximum is 10000 x 10000 pixels. The maximum PDF dimension is 17 x 17 inches.
    ", + "examples": { + "application/json": { + "error": { + "code": "BadArgument", + "message": "Invalid input." + } + } + } + }, + "415": { + "description": "Unsupported media type error. 'Content-Type' does not match the POST content.\n
  • For image URL, 'Content-Type' should be application/json.
  • For binary image data, 'Content-Type' should be application/octet-stream.

  • ", + "examples": { + "application/json": { + "error": { + "code": "BadArgument", + "message": "Unsupported media type." + } + } + } + }, + "500": { + "description": "Internal server error.", + "examples": { + "application/json": { + "error": { + "code": "Unspecified", + "message": "Internal server error." + } + } + } + }, + "503": { + "description": "Transient fault while querying Windows Azure storage services.", + "examples": { + "application/json": { + "error": { + "code": "StorageException", + "message": "Transient fault occurred while querying Windows Azure storage services. Please try again later." + } + } } } }, "x-ms-examples": { - "Successful 'Batch Read Receipt' request": { - "$ref": "./examples/SuccessfulBatchReadReceiptWithStream.json" + "Successful 'Analyze Receipt' request": { + "$ref": "./examples/SuccessfulAnalyzeReceiptWithStream.json" } } } } }, "definitions": { - "readReceiptResult": { + "OperationStatus": { + "type": "string", + "description": "Analysis operation status. Possible values:", + "enum": [ + "NotStarted", + "Running", + "Failed", + "Succeeded" + ], + "x-ms-enum": { + "name": "OperationStatusCodes", + "modelAsString": false + }, + "x-nullable": false + }, + "TextRecognitionResult": { + "description": "Text recognition result from a page in the input document.", "type": "object", - "description": "Analysis result of the 'Batch Read Receipt' operation.", + "required": [ + "lines" + ], + "properties": { + "page": { + "description": "The 1-based page number of the recognition result.", + "type": "integer" + }, + "clockwiseOrientation": { + "description": "The orientation of the image in clockwise direction, measured in degrees between [0, 360).", + "type": "number" + }, + "width": { + "description": "The width of the image/PDF in pixels/inches, respectively.", + "type": "number" + }, + "height": { + "description": "The height of the image/PDF in pixels/inches, respectively.", + "type": "number" + }, + "unit": { + "description": "The unit used by the width, height and boundingBox properties. For images, the unit is \"pixel\". For PDF, the unit is \"inch\".", + "type": "string", + "enum": [ + "pixel", + "inch" + ], + "x-ms-enum": { + "name": "TextRecognitionResultDimensionUnit", + "modelAsString": false + }, + "x-nullable": true + }, + "lines": { + "description": "A list of recognized text lines. The maximum number of lines returned is 300 per page.\n\nThe lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.", + "type": "array", + "items": { + "$ref": "#/definitions/Line" + } + } + } + }, + "Line": { + "description": "An object representing a recognized text line.", + "type": "object", + "properties": { + "boundingBox": { + "description": "Bounding box of a recognized line.", + "$ref": "#/definitions/BoundingBox" + }, + "text": { + "description": "The text content of the line.", + "type": "string" + }, + "words": { + "description": "List of words in the text line.", + "type": "array", + "items": { + "$ref": "#/definitions/Word" + } + } + } + }, + "Word": { + "description": "An object representing a recognized word.", + "type": "object", + "required": [ + "boundingBox", + "text" + ], + "properties": { + "boundingBox": { + "description": "Bounding box of a recognized word.", + "$ref": "#/definitions/BoundingBox" + }, + "text": { + "description": "The text content of the word.", + "type": "string" + }, + "confidence": { + "description": "Qualitative confidence measure.", + "type": "string", + "enum": [ + "High", + "Low" + ], + "x-ms-enum": { + "name": "TextRecognitionResultConfidenceClass", + "modelAsString": false + }, + "x-nullable": true + } + } + }, + "BoundingBox": { + "description": "Quadrangle bounding box, with coordinates specified relative to the original image. The eight numbers represent the four points, clockwise from the top-left corner. For image, the (x, y) coordinates are measured in pixels. For PDF, the (x, y) coordinates are measured in inches.", + "type": "array", + "items": { + "type": "number", + "x-nullable": false + } + }, + "analyzeReceiptResult": { + "type": "object", + "description": "Result of the 'Analyze Receipt' operation.", "properties": { "status": { - "description": "Status of the read operation.", - "$ref": "FormRecognizerReceiptOcr.json#/definitions/OperationStatus" + "description": "Status of the analysis operation.", + "$ref": "#/definitions/OperationStatus" }, "recognitionResults": { - "description": "Text recognition result of the 'Batch Read Receipt' operation.", + "description": "An array of objects, each representing the OCR result for a page in the input document.", "type": "array", "items": { - "$ref": "FormRecognizerReceiptOcr.json#/definitions/TextRecognitionResult" + "$ref": "#/definitions/TextRecognitionResult" } }, "understandingResults": { - "description": "Semantic understanding result of the 'Batch Read Receipt' operation.", + "description": "An array of objects, each representing a receipt detected in the input document.", "type": "array", "items": { "$ref": "#/definitions/understandingResult" @@ -177,7 +406,7 @@ "description": "A set of extracted fields corresponding to a semantic object, such as a receipt, in the input document.", "properties": { "pages": { - "description": "List of pages where the document is found.", + "description": "List of pages where the receipt is found.", "type": "array", "items": { "type": "integer", @@ -185,7 +414,7 @@ } }, "fields": { - "description": "Dictionary of recognized field values.", + "description": "Dictionary of analyzed field values. If a field is not detected, the corresponding field value will be set to null.", "type": "object", "additionalProperties": { "$ref": "#/definitions/fieldValue" @@ -194,9 +423,10 @@ } }, "elementReference": { - "description": "Reference to an OCR word.", + "description": "Reference to an OCR word element.", "properties": { "$ref": { + "description": "JSON pointer to an OCR word element. For example, \"#/recognitionResults/0/lines/1/words/2\" refers to 3rd word in the 2nd line of the 1st page in the document.", "type": "string" } } @@ -214,7 +444,7 @@ "type": "string" }, "text": { - "description": "OCR text content of the recognized field.", + "description": "Extracted text content of the recognized field.", "type": "string" }, "elements": { @@ -253,6 +483,51 @@ "type": "number" } } + }, + "ImageUrl": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "description": "Publicly reachable URL of an image.", + "type": "string" + } + } + } + }, + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ImageUrl": { + "name": "ImageUrl", + "in": "body", + "required": true, + "x-ms-parameter-location": "method", + "x-ms-client-flatten": true, + "description": "A JSON document with a URL pointing to the image that is to be analyzed.", + "schema": { + "$ref": "#/definitions/ImageUrl" + } + }, + "ImageStream": { + "name": "Image", + "in": "body", + "required": true, + "x-ms-parameter-location": "method", + "description": "An image stream.", + "schema": { + "type": "object", + "format": "file" + } } } } diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceiptOcr.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceiptOcr.json deleted file mode 100644 index 4039f523e2f9..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizerReceiptOcr.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0-preview", - "title": "Form Recognizer Client", - "description": "The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively." - }, - "definitions": { - "OperationStatus": { - "type": "string", - "description": "Status code of the text operation.", - "enum": [ - "Not Started", - "Running", - "Failed", - "Succeeded" - ], - "x-ms-enum": { - "name": "TextOperationStatusCodes", - "modelAsString": false - }, - "x-nullable": false - }, - "TextRecognitionResult": { - "description": "An object representing a recognized text region", - "type": "object", - "required": [ - "lines" - ], - "properties": { - "page": { - "description": "The 1-based page number of the recognition result.", - "type": "integer" - }, - "clockwiseOrientation": { - "description": "The orientation of the image in degrees in the clockwise direction. Range between [0, 360).", - "type": "number" - }, - "width": { - "description": "The width of the image in pixels or the PDF in inches.", - "type": "number" - }, - "height": { - "description": "The height of the image in pixels or the PDF in inches.", - "type": "number" - }, - "unit": { - "description": "The unit used in the Width, Height and BoundingBox. For images, the unit is 'pixel'. For PDF, the unit is 'inch'.", - "type": "string", - "enum": [ - "pixel", - "inch" - ], - "x-ms-enum": { - "name": "TextRecognitionResultDimensionUnit", - "modelAsString": false - }, - "x-nullable": true - }, - "lines": { - "description": "A list of recognized text lines.", - "type": "array", - "items": { - "$ref": "#/definitions/Line" - } - } - } - }, - "Line": { - "description": "An object representing a recognized text line.", - "type": "object", - "properties": { - "boundingBox": { - "description": "Bounding box of a recognized line.", - "$ref": "#/definitions/BoundingBox" - }, - "text": { - "description": "The text content of the line.", - "type": "string" - }, - "words": { - "description": "List of words in the text line.", - "type": "array", - "items": { - "$ref": "#/definitions/Word" - } - } - } - }, - "Word": { - "description": "An object representing a recognized word.", - "type": "object", - "required": [ - "boundingBox", - "text" - ], - "properties": { - "boundingBox": { - "description": "Bounding box of a recognized word.", - "$ref": "#/definitions/BoundingBox" - }, - "text": { - "description": "The text content of the word.", - "type": "string" - }, - "confidence": { - "description": "Qualitative confidence measure.", - "type": "string", - "enum": [ - "High", - "Low" - ], - "x-ms-enum": { - "name": "TextRecognitionResultConfidenceClass", - "modelAsString": false - }, - "x-nullable": true - } - } - }, - "BoundingBox": { - "description": "Quadrangle bounding box, with coordinates in original image. The eight numbers represent the four points (x-coordinate, y-coordinate from the left-top corner of the image) of the detected rectangle from the left-top corner in the clockwise direction. For images, coordinates are in pixels. For PDF, coordinates are in inches.", - "type": "array", - "items": { - "type": "integer", - "x-nullable": false - } - }, - "ComputerVisionError": { - "description": "Details about the API request error.", - "required": [ - "code", - "message" - ], - "type": "object", - "properties": { - "code": { - "description": "The error code.", - "enum": [ - "InvalidImageFormat", - "UnsupportedMediaType", - "InvalidImageUrl", - "NotSupportedFeature", - "NotSupportedImage", - "Timeout", - "InternalServerError", - "InvalidImageSize", - "BadArgument", - "DetectFaceError", - "NotSupportedLanguage", - "InvalidThumbnailSize", - "InvalidDetails", - "InvalidModel", - "CancelledRequest", - "NotSupportedVisualFeature", - "FailedToProcess", - "Unspecified", - "StorageException" - ], - "x-ms-enum": { - "name": "ComputerVisionErrorCodes", - "modelAsString": true - } - }, - "message": { - "description": "A message explaining the error reported by the service.", - "type": "string" - }, - "requestId": { - "description": "A unique request identifier.", - "type": "string" - } - } - }, - "ImageUrl": { - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "description": "Publicly reachable URL of an image.", - "type": "string" - } - } - } - }, - "parameters": { - "ImageUrl": { - "name": "ImageUrl", - "in": "body", - "required": true, - "x-ms-parameter-location": "method", - "x-ms-client-flatten": true, - "description": "A JSON document with a URL pointing to the image that is to be analyzed.", - "schema": { - "$ref": "#/definitions/ImageUrl" - } - }, - "ImageStream": { - "name": "Image", - "in": "body", - "required": true, - "x-ms-parameter-location": "method", - "description": "An image stream.", - "schema": { - "type": "object", - "format": "file" - } - }, - "Endpoint": { - "name": "Endpoint", - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", - "x-ms-parameter-location": "client", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - } - }, - "paths": {} -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulAnalyzeReceiptWithStream.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulAnalyzeReceiptWithStream.json new file mode 100644 index 000000000000..59f7b7c3c12e --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulAnalyzeReceiptWithStream.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": "{Image binary}" + }, + "responses": { + "202": { + "header": { + "Operation-Location": "https://{CognitiveService}/formrecognizer/v1.0-preview/prebuilt/receipt/operations/54f0b076-4e38-43e5-81bd-b85b8835fdfb" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulAnalyzeReceiptWithUrl.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulAnalyzeReceiptWithUrl.json new file mode 100644 index 000000000000..fb2143ce77f9 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulAnalyzeReceiptWithUrl.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "url": "{Url}" + } + }, + "responses": { + "202": { + "header": { + "Operation-Location": "https://{CognitiveService}/formrecognizer/v1.0-preview/prebuilt/receipt/operations/54f0b076-4e38-43e5-81bd-b85b8835fdfb" + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulBatchReadReceiptWithStream.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulBatchReadReceiptWithStream.json deleted file mode 100644 index 7a7a35ec623f..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulBatchReadReceiptWithStream.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "parameters": { - "Endpoint": "{Endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "Image": "{binary}" - }, - "responses": { - "202": { - "header": { - "Operation-Location": "https://{domain}/vision/v2.0/read/receipt/operations/e56ffa6e-1ee4-4042-bc07-993db706c95f" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulBatchReadReceiptWithUrl.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulBatchReadReceiptWithUrl.json deleted file mode 100644 index e8816ded9af6..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulBatchReadReceiptWithUrl.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "parameters": { - "Endpoint": "{Endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "ImageUrl": "{url}" - }, - "responses": { - "202": { - "header": { - "Operation-Location": "https://{domain}/vision/v2.0/read/receipt/operations/e56ffa6e-1ee4-4042-bc07-993db706c95f" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulReadReceiptResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulGetReceiptResult.json similarity index 100% rename from specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulReadReceiptResult.json rename to specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/SuccessfulGetReceiptResult.json diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.md index c646ca05210c..5295096e8fbf 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/readme.md +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.md @@ -21,7 +21,6 @@ These settings apply only when `--tag=release_1_0` is specified on the command l input-file: - preview/v1.0/FormRecognizer.json - preview/v1.0/FormRecognizerReceipt.json - - preview/v1.0/FormRecognizerReceiptOcr.json ``` ## Swagger to SDK