Skip to content

Commit f3376c2

Browse files
authored
Merge pull request #270990 from laujan/236794-rest-preview-updates
update rest api quickstart and how-to articles
2 parents dedb28b + aba6ce4 commit f3376c2

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

articles/ai-services/document-intelligence/how-to-guides/includes/v4-0/rest-api.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: lajanuar
1515
>
1616
> This project uses cURL command-line tool to execute REST API calls.
1717
18-
[Document Intelligence REST API](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2023-07-31&preserve-view=true&tabs=HTTP) | [Azure client libraries](https://azure.github.io/azure-sdk/releases/latest/index.html) | [Supported client libraries](../../../sdk-overview-v3-1.md)
18+
| [Document Intelligence REST API](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2024-02-29-preview&preserve-view=true&tabs=HTTP) | [Supported Azure SDKS](../../../sdk-overview-v4-0.md)
1919

2020
## Prerequisites
2121

@@ -62,26 +62,26 @@ Use the following table as a reference. Replace *\<modelId>* and *\<document-url
6262
Open a console window and run the following cURL command. The commands include the endpoint and key environment variables previously created in the set environment variables section. Replace those variables if your variable names differ. Remember to replace the *\<modelId>* and *\<document-url>* parameters.
6363

6464
```console
65-
curl -i -X POST "%FR_ENDPOINT%formrecognizer/documentModels/<modelId>:analyze?api-version=2023-07-31" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: %FR_KEY%" --data-ascii "{'urlSource': '<document-url>'}"
65+
curl -i -X POST "%DI_ENDPOINT%/documentintelligence/documentModels/{modelId}:analyze?api-version=2024-02-29-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: %DI_KEY%" --data-ascii "{'urlSource': '<document-url>'}"
6666
```
6767

68-
To enable add-on capabilities, use the `features` query parameter in the POST request. There are four add-on capabilities available with the `2023-07-31` (GA) release: *ocr.highResolution*, *ocr.formula*, *ocr.font*, and *queryFields.premium*. To learn more about each of the capabilities, see [Custom models](../../../concept-accuracy-confidence.md).
68+
To enable add-on capabilities, use the `features` query parameter in the POST request. There are four add-on capabilities available with the `2023-07-31` (GA) and later releases: *ocr.highResolution*, *ocr.formula*, *ocr.font*, and *queryFields.premium*. To learn more about each of the capabilities, see [Custom models](../../../concept-accuracy-confidence.md).
6969

7070
You can only call the *highResolution*, *formula*, and *font* capabilities for the Read and Layout model, and the *queryFields* capability for the General Documents model. The following example shows how to call the *highResolution*, *formula*, and *font* capabilities for the Layout model.
7171

7272
```bash
73-
curl -i -X POST "%FR_ENDPOINT%formrecognizer/documentModels/prebuilt-layout:analyze?features=ocr.highResolution,ocr.formula,ocr.font?api-version=2023-07-31" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: %FR_KEY%" --data-ascii "{'urlSource': '<document-url>'}"
73+
curl -i -X POST "%DI_ENDPOINT%documentintelligence/documentModels/prebuilt-layout:analyze?features=ocr.highResolution,ocr.formula,ocr.font?api-version=2024-02-29-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: %DI_KEY%" --data-ascii "{'urlSource': '<document-url>'}"
7474
```
7575

7676
### POST response
7777

7878
You receive a `202 (Success)` response that includes an `Operation-location` header. Use the value of this header to retrieve the response results.
7979

80-
:::image type="content" source="../../../media/how-to/rest-get-response.png" alt-text="Screenshot shows a POST response with the operation location highlighted.":::
80+
:::image type="content" source="../../../media/quickstarts/operation-location-result-id.png" alt-text="Screenshot shows a POST response with the operation location highlighted.":::
8181

8282
### Get analyze result (GET Request)
8383

84-
After you call the [`Analyze document`](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2023-07-31&preserve-view=true&tabs=HTTP) API, call the [`Get analyze` result}(/rest/api/aiservices/document-models/get-analyze-result?view=rest-aiservices-2023-07-31&preserve-view=true&tabs=HTTP) API to get the status of the operation and the extracted data.
84+
After you call the [`Analyze document`](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2024-02-29-preview&preserve-view=true&tabs=HTTP) API, call the [`Get analyze` result}(/rest/api/aiservices/document-models/get-analyze-result?view=rest-aiservices-2024-02-29-preview&preserve-view=true&tabs=HTTP) API to get the status of the operation and the extracted data.
8585

8686
<!-- markdownlint-disable MD024 -->
8787

@@ -100,7 +100,7 @@ Use the NodeJS *json tool* as a JSON formatter for cURL. If you don't have [Node
100100
1. Pretty print the JSON output by including the pipe character `| json` with your GET requests.
101101

102102
```console
103-
curl -i -X GET "<endpoint>formrecognizer/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2023-07-31"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json
103+
curl -i -X GET "<endpoint>documentintelligence/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2024-02-29-preview"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json
104104
```
105105

106106
#### [macOS](#tab/macOS)
@@ -110,7 +110,7 @@ The *json_pp* command tool ships with macOS and can be used as a JSON formatter
110110
- Pretty print the JSON output by including `| json_pp` with your GET requests.
111111

112112
```console
113-
curl -i -X GET "{endpoint}formrecognizer/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2023-07-31"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json_pp
113+
curl -i -X GET "{endpoint}documentintelligence/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2024-02-29-preview"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json_pp
114114
```
115115

116116
#### [Linux](#tab/linux)
@@ -120,7 +120,7 @@ The *json_pp* command line tool is preinstalled in most Linux distributions. If
120120
- Pretty print the JSON output by including `| json_pp` with your `GET` requests.
121121

122122
```console
123-
curl -i -X GET "<endpoint>formrecognizer/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2023-07-31"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json_pp
123+
curl -i -X GET "<endpoint>documentintelligence/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2024-02-29-preview"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json_pp
124124
```
125125

126126
---
@@ -130,11 +130,11 @@ The *json_pp* command line tool is preinstalled in most Linux distributions. If
130130
Before you run the following command, make these changes:
131131

132132
- Replace *\<POST response>* with the `Operation-location` header from the [POST response](#post-response).
133-
- Replace *\<FR_KEY* with the variable for your environment variable if it differs from the name in the code.
133+
- Replace *\<DI_KEY* with the variable for your environment variable if it differs from the name in the code.
134134
- Replace *\<json-tool> with your JSON formatting tool.
135135

136136
```console
137-
curl -i -X GET "<POST response>" -H "Ocp-Apim-Subscription-Key: %FR_KEY%" | `<json-tool>`
137+
curl -i -X GET "<POST response>" -H "Ocp-Apim-Subscription-Key: %DI_KEY%" | `<json-tool>`
138138
```
139139

140140
### Examine the response
29 KB
Loading

articles/ai-services/document-intelligence/quickstarts/includes/rest-api.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
---
2-
title: "Quickstart: Document Intelligence (formerly Form Recognizer) REST API v3.0 | v3.0"
2+
title: "Quickstart: Document Intelligence (formerly Form Recognizer) REST API"
33
titleSuffix: Azure AI services
44
description: Form and document processing, data extraction, and analysis using Document Intelligence REST API v3.0
55
author: laujan
66
manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.topic: include
9-
ms.date: 03/28/2024
9+
ms.date: 04/02/2024
1010
ms.author: lajanuar
1111
---
1212

1313
<!-- markdownlint-disable MD036 -->
1414

15+
:::moniker range="doc-intel-4.0.0"
16+
| [Document Intelligence REST API](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2024-02-29-preview&preserve-view=true&tabs=HTTP) | [Supported Azure SDKS](../../sdk-overview-v4-0.md)
17+
:::moniker-end
18+
1519
:::moniker range="doc-intel-3.1.0"
1620
| [Document Intelligence REST API](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2023-07-31&preserve-view=true&tabs=HTTP) | [Supported Azure SDKS](../../sdk-overview-v3-1.md) |
1721
:::moniker-end
@@ -195,8 +199,8 @@ You receive a `200 (Success)` response with JSON output. The first field, `"stat
195199
```json
196200
{
197201
"status": "succeeded",
198-
"createdDateTime": "2023-11-25T19:31:37Z",
199-
"lastUpdatedDateTime": "2023-11-25T19:31:43Z",
202+
"createdDateTime": "2024-03-25T19:31:37Z",
203+
"lastUpdatedDateTime": "2024-03-25T19:31:43Z",
200204
"analyzeResult": {
201205
"apiVersion": "2024-02-29-preview",
202206
"modelId": "prebuilt-invoice",

0 commit comments

Comments
 (0)