你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Analyzer - Analyze Receipt
从给定的回执文档中提取字段文本和语义值。 输入文档必须是受支持的内容类型之一-“application/pdf”、“image/jpeg”、“image/png”、“image/tiff”或“image/bmp”。 或者,使用“application/json”类型指定要分析的文档 (uri) 的位置。
POST {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyze
POST {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyze?includeTextDetails={includeTextDetails}&locale={locale}&pages={pages}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string |
支持的认知服务终结点 (协议和主机名,例如: https://westus2.api.cognitive.microsoft.com) 。 |
include
|
query |
boolean |
在结果中包含文本行和元素引用。 |
|
locale
|
query |
输入文档的区域设置。 支持的区域设置包括:en-AU、en-CA、en-GB、en-IN、en-US (默认) 。 |
||
pages
|
query |
string[] |
多页文档的自定义页码 (PDF/TIFF) ,输入要获取 OCR 结果的页码。 对于一系列页面,请使用连字符。 用逗号分隔每个页面或区域。 |
请求头
Media Types: "application/pdf", "application/json", "image/jpeg", "image/png", "image/tiff", "image/bmp"
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
请求正文
Media Types: "application/pdf", "application/json", "image/jpeg", "image/png", "image/tiff", "image/bmp"
名称 | 类型 | 说明 |
---|---|---|
source |
string |
文件源路径。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
请求已成功排队。 标头 Operation-Location: string |
|
Other Status Codes |
包含有关错误的其他详细信息的未成功响应的响应实体。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Analyze receipt
示例请求
POST {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyze
示例响应
Operation-Location: {endpoint}/formrecognizer/v2.1/prebuilt/receipt/analyzeResults/3b1e6c5b-e113-4114-ab6b-ce65dfe8050f
定义
名称 | 说明 |
---|---|
Error |
|
Error |
|
Locale |
输入文档的区域设置。 支持的区域设置包括:en-AU、en-CA、en-GB、en-IN、en-US (默认) 。 |
Source |
源数据的 URI 或本地路径。 |
ErrorInformation
名称 | 类型 | 说明 |
---|---|---|
code |
string |
|
message |
string |
ErrorResponse
名称 | 类型 | 说明 |
---|---|---|
error |
Locale
输入文档的区域设置。 支持的区域设置包括:en-AU、en-CA、en-GB、en-IN、en-US (默认) 。
名称 | 类型 | 说明 |
---|---|---|
en-AU |
string |
|
en-CA |
string |
|
en-GB |
string |
|
en-IN |
string |
|
en-US |
string |
SourcePath
源数据的 URI 或本地路径。
名称 | 类型 | 说明 |
---|---|---|
source |
string |
文件源路径。 |