Skip to content

Commit 49c0535

Browse files
Merge pull request #2814 from laujan/361139-update-samples-how-to-quickstart
update cURL
2 parents 9854b64 + 50514cd commit 49c0535

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed

articles/ai-services/document-intelligence/how-to-guides/includes/v4-0/csharp-sdk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: laujan
55
manager: nitinme
66
ms.service: azure-ai-document-intelligence
77
ms.topic: include
8-
ms.date: 11/19/2024
8+
ms.date: 02/07/2025
99
ms.author: lajanuar
1010
ms.custom: devx-track-csharp, linux-related-content
1111
monikerRange: 'doc-intel-4.0.0'
@@ -88,7 +88,7 @@ monikerRange: 'doc-intel-4.0.0'
8888
8989
1. Open the *Program.cs* file.
9090

91-
1. Delete the pre-existing code, including the line `Console.Writeline("Hello World!")`.
91+
1. Delete the existing code, including the line `Console.Writeline("Hello World!")`.
9292

9393
1. Select one of the following code samples and copy/paste into your application's *Program.cs* file:
9494

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: nitinme
66
ms.service: azure-ai-document-intelligence
77
ms.custom: linux-related-content
88
ms.topic: include
9-
ms.date: 11/19/2024
9+
ms.date: 02/07/2025
1010
ms.author: lajanuar
1111
---
1212
<!-- markdownlint-disable MD033 -->
@@ -16,14 +16,14 @@ ms.author: lajanuar
1616
>
1717
> This project uses cURL command-line tool to execute REST API calls.
1818
19-
| [Document Intelligence REST API](/rest/api/aiservices/operation-groups?view=rest-aiservices-v4.0%20(2024-11-30)&preserve-view=true) | [Supported Azure SDKS](../../../sdk-overview-v4-0.md)
19+
| [Document Intelligence REST API](/rest/api/aiservices/operation-groups?view=rest-aiservices-v4.0%20(2024-11-30)&preserve-view=true) | [Supported Azure `SDK`s](../../../sdk-overview-v4-0.md)
2020

2121
## Prerequisites
2222

2323
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/).
2424
- The cURL command line tool installed. Windows 10 and Windows 11 ship with a copy of cURL. At a command prompt, type the following cURL command. If the help options display, cURL is installed in your Windows environment.
2525

26-
```console
26+
```bash
2727
curl -help
2828
```
2929

@@ -60,18 +60,18 @@ Use the following table as a reference. Replace *\<modelId>* and *\<document-url
6060

6161
## POST request
6262

63-
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.
63+
Open a bash 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.
6464

65-
```console
66-
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>'}"
65+
```bash
66+
curl -i -X POST "POST {endpoint}/documentintelligence/documentModels/{modelId}:analyze?_overload=analyzeDocument&api-version=2024-11-30" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {DI_KEY}" --data-ascii "{'urlSource': '<document-url>'}"
6767
```
6868

6969
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).
7070

7171
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.
7272

7373
```bash
74-
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>'}"
74+
curl -i -X POST "{endpoint}/documentintelligence/documentModels/prebuilt-layout:analyze?features=ocr.highResolution,ocr.formula,ocr.font?api-version=2024-11-30" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {DI_KEY}" --data-ascii "{'urlSource': '<document-url>'}"
7575
```
7676

7777
### POST response
@@ -82,7 +82,7 @@ You receive a `202 (Success)` response that includes an `Operation-location` hea
8282

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

85-
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.
85+
After you call the [`Analyze document`](/rest/api/aiservices/document-models/analyze-batch-documents?view=rest-aiservices-v4.0%20(2024-11-30)&preserve-view=true&tabs=HTTP) API, call the [`Get analyze` result](/rest/api/aiservices/document-models/get-analyze-result?view=rest-aiservices-v4.0%20(2024-11-30)&preserve-view=true&tabs=HTTP) API to get the status of the operation and the extracted data.
8686

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

@@ -92,16 +92,16 @@ The cURL command line tool doesn't format API responses that contain JSON conten
9292

9393
Use the NodeJS *json tool* as a JSON formatter for cURL. If you don't have [Node.js](https://nodejs.org/) installed, download and install the latest version.
9494

95-
1. Open a console window and install the json tool by using the following command:
95+
1. Open a bash window and install the json tool by using the following command:
9696

97-
```console
97+
```bash
9898
npm install -g jsontool
9999
```
100100

101101
1. Pretty print the JSON output by including the pipe character `| json` with your GET requests.
102102

103-
```console
104-
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
103+
```bash
104+
curl -i -X GET "<endpoint>documentintelligence/documentModels/prebuilt-read/analyzeResults/0e49604a-2d8e-4b15-b6b8-bb456e5d3e0a?api-version=2024-11-30"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json
105105
```
106106

107107
#### [macOS](#tab/macOS)
@@ -110,8 +110,8 @@ The *json_pp* command tool ships with macOS and can be used as a JSON formatter
110110

111111
- Pretty print the JSON output by including `| json_pp` with your GET requests.
112112

113-
```console
114-
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
113+
```bash
114+
curl -i -X GET "{endpoint}/documentintelligence/documentModels/{modelId}/analyzeResults/{resultId}?api-version=2024-11-30"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json_pp
115115
```
116116

117117
#### [Linux](#tab/linux)
@@ -120,8 +120,8 @@ The *json_pp* command line tool is preinstalled in most Linux distributions. If
120120

121121
- Pretty print the JSON output by including `| json_pp` with your `GET` requests.
122122

123-
```console
124-
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
123+
```bash
124+
curl -i -X GET "{endpoint}/documentintelligence/documentModels/{modelId}/analyzeResults/{resultId}?api-version=2024-11-30"-H "Ocp-Apim-Subscription-Key: <subscription key>" | json_pp
125125
```
126126

127127
---
@@ -134,8 +134,8 @@ Before you run the following command, make these changes:
134134
- Replace *\<DI_KEY* with the variable for your environment variable if it differs from the name in the code.
135135
- Replace *\<json-tool> with your JSON formatting tool.
136136

137-
```console
138-
curl -i -X GET "<POST response>" -H "Ocp-Apim-Subscription-Key: %DI_KEY%" | `<json-tool>`
137+
```bash
138+
curl -i -X GET "<POST response>" -H "Ocp-Apim-Subscription-Key: {DI_KEY}" | `<json-tool>`
139139
```
140140

141141
### Examine the response

articles/ai-services/document-intelligence/how-to-guides/use-sdk-rest-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.custom: devx-track-dotnet, devx-track-extended-java, devx-track-js, devx-track-python, linux-related-content
99
ms.topic: how-to
10-
ms.date: 11/19/2024
10+
ms.date: 02/07/2025
1111
ms.author: lajanuar
1212
zone_pivot_groups: programming-languages-set-formre
1313
---

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: laujan
66
manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.topic: include
9-
ms.date: 11/19/2024
9+
ms.date: 02/07/2025
1010
ms.author: lajanuar
1111
---
1212

@@ -47,7 +47,7 @@ In this quickstart, learn to use the Document Intelligence REST API to analyze a
4747
* A Document Intelligence (single-service) or Azure AI services (multi-service) resource. Once you have your Azure subscription, create a [single-service](https://portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer) or [multi-service](https://portal.azure.com/#create/Microsoft.CognitiveServicesAIServices) Document Intelligence resource, in the Azure portal, to get your key and endpoint. You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
4848

4949
> [!TIP]
50-
> Create an Azure AI services resource if you plan to access multiple Azure AI services under a single endpoint/key. For Document Intelligence access only, create a Document Intelligence resource. Please note that you'll need a single-service resource if you intend to use [Microsoft Entra authentication](/azure/active-directory/authentication/overview-authentication).
50+
> Create an Azure AI services resource if you plan to access multiple Azure AI services under a single endpoint/key. For Document Intelligence access only, create a Document Intelligence resource. You need a single-service resource if you intend to use [Microsoft Entra authentication](/azure/active-directory/authentication/overview-authentication).
5151
5252
* After your resource deploys, select **Go to resource**. You need the key and endpoint from the resource you create to connect your application to the Document Intelligence API. You paste your key and endpoint into the code later in the quickstart:
5353

@@ -75,13 +75,13 @@ Before you run the cURL command, make the following changes to the [post request
7575

7676
| **Feature** | **{modelID}** | **{your-document-url}** |
7777
| --- | --- |--|
78-
| **Read** | prebuilt-read | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png` |
79-
| **Layout** | prebuilt-layout | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/layout.png` |
80-
| **Health insurance card** | prebuilt-healthInsuranceCard.us | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/insurance-card.png` |
81-
| **W-2** | prebuilt-tax.us.w2 | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/w2.png` |
82-
| **Invoice** | prebuilt-invoice | `https://github.com/Azure-Samples/cognitive-services-REST-api-samples/raw/master/curl/form-recognizer/rest-api/invoice.pdf` |
83-
| **Receipt** | prebuilt-receipt | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/receipt.png` |
84-
| **ID document** | prebuilt-idDocument | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/identity_documents.png` |
78+
| **Read** | `prebuilt-read` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png` |
79+
| **Layout** | `prebuilt-layout` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/layout.png` |
80+
| **Health insurance card** | `prebuilt-healthInsuranceCard.us` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/insurance-card.png` |
81+
| **W-2** | `prebuilt-tax.us.w2` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/w2.png` |
82+
| **Invoice** | `prebuilt-invoice` | `https://github.com/Azure-Samples/cognitive-services-REST-api-samples/raw/master/curl/form-recognizer/rest-api/invoice.pdf` |
83+
| **Receipt** | `prebuilt-receipt` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/receipt.png` |
84+
| **ID document** | `prebuilt-idDocument` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/identity_documents.png` |
8585
:::moniker-end
8686

8787
:::moniker range="doc-intel-3.1.0 || doc-intel-3.0.0"
@@ -90,15 +90,15 @@ Before you run the cURL command, make the following changes to the [post request
9090

9191
| **Feature** | **{modelID}** | **{your-document-url}** |
9292
| --- | --- |--|
93-
| **General Document** | prebuilt-document | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf` |
94-
| **Read** | prebuilt-read | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png` |
95-
| **Layout** | prebuilt-layout | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/layout.png` |
96-
| **Health insurance card** | prebuilt-healthInsuranceCard.us | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/insurance-card.png` |
97-
| **W-2** | prebuilt-tax.us.w2 | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/w2.png` |
98-
| **Invoice** | prebuilt-invoice | `https://github.com/Azure-Samples/cognitive-services-REST-api-samples/raw/master/curl/form-recognizer/rest-api/invoice.pdf` |
99-
| **Receipt** | prebuilt-receipt | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/receipt.png` |
100-
| **ID document** | prebuilt-idDocument | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/identity_documents.png` |
101-
| **Business card** | prebuilt-businessCard | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/de5e0d8982ab754823c54de47a47e8e499351523/curl/form-recognizer/rest-api/business_card.jpg` |
93+
| **General Document** | `prebuilt-document` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf` |
94+
| **Read** | `prebuilt-read` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png` |
95+
| **Layout** | `prebuilt-layout` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/layout.png` |
96+
| **Health insurance card** | `prebuilt-healthInsuranceCard.us` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/insurance-card.png` |
97+
| **W-2** | `prebuilt-tax.us.w2` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/w2.png` |
98+
| **Invoice** | `prebuilt-invoice` | `https://github.com/Azure-Samples/cognitive-services-REST-api-samples/raw/master/curl/form-recognizer/rest-api/invoice.pdf` |
99+
| **Receipt** | `prebuilt-receipt` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/receipt.png` |
100+
| **ID document** | `prebuilt-idDocument` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/identity_documents.png` |
101+
| **Business card** | `prebuilt-businessCard` | `https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/de5e0d8982ab754823c54de47a47e8e499351523/curl/form-recognizer/rest-api/business_card.jpg` |
102102
:::moniker-end
103103

104104
> [!IMPORTANT]

0 commit comments

Comments
 (0)