Skip to content

Commit 2c0216f

Browse files
authored
add resultid and sample image response
1 parent d5e1151 commit 2c0216f

File tree

1 file changed

+32
-43
lines changed

1 file changed

+32
-43
lines changed

articles/ai-services/content-understanding/quickstart/use-rest-api.md

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -50,49 +50,58 @@ curl -i -X POST "{endpoint}/analyzers/{analyzerId}:analyze?api-version=2025-05-0
5050

5151
# [Document](#tab/document)
5252

53-
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal
53+
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal.
5454
2. Replace `{analyzerId}` with `prebuilt-documentAnalyzer`.
55-
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/blob/main/data/invoice.pdf`.
55+
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/raw/refs/heads/main/data/invoice.pdf`.
5656

5757
# [Image](#tab/image)
5858

59-
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal
60-
2. Replace `{analyzerId}` with `prebuilt-imageAnalyzer`
61-
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/blob/main/data/pieChart.jpg`
59+
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal.
60+
2. Replace `{analyzerId}` with `prebuilt-imageAnalyzer`.
61+
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/raw/refs/heads/main/data/pieChart.jpg`.
6262

6363
# [Audio](#tab/audio)
6464

65-
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal
66-
2. Replace `{analyzerId}` with `prebuilt-audioAnalyzer`
67-
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/blob/main/data/audio.wav`
65+
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal.
66+
2. Replace `{analyzerId}` with `prebuilt-audioAnalyzer`.
67+
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/raw/refs/heads/main/data/audio.wav`.
6868

6969
# [Video](#tab/video)
7070

71-
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal
72-
2. Replace `{analyzerId}` with `prebuilt-videoAnalyzer`
73-
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/blob/main/data/FlightSimulator.mp4`
71+
1. Replace `{endpoint}` and `{key}` with the corresponding values from your Azure AI Services instance in the Azure portal.
72+
2. Replace `{analyzerId}` with `prebuilt-videoAnalyzer`.
73+
3. Replace `{fileUrl}` with a publicly accessible URL of the file to analyze—such as a path to an Azure Storage Blob with a shared access signature (SAS), or use the sample URL: `https://github.com/Azure-Samples/azure-ai-content-understanding-python/raw/refs/heads/main/data/FlightSimulator.mp4`.
7474
---
7575

7676

7777
#### POST Response
7878

79-
The 202 (`Accepted`) response includes an `operation-location` header containing a URL that you can use to track the status of this asynchronous analyze operation.
79+
The response returns `resultId` that you can use to track the status of this asynchronous analyze operation.
8080

8181
```
82-
202 Accepted
83-
operation-location: {endpoint}/contentunderstanding/analyzerResults/{requestId}?api-version=2025-05-01-preview
82+
{
83+
"id": {resultId},
84+
"status": "Running",
85+
"result": {
86+
"analyzerId": {analyzerId},
87+
"apiVersion": "2025-05-01-preview",
88+
"createdAt": "YYYY-MM-DDTHH:MM:SSZ",
89+
"warnings": [],
90+
"contents": []
91+
}
92+
}
8493
```
8594

8695
### Get Analyze Result
8796

88-
Use the `resultId` from the `Operation-Location` header returned by the previous `POST` response and retrieve the result of the analysis.
97+
Use the `resultId` from the `POST` response above and retrieve the result of the analysis.
8998

9099
1. Replace `{endpoint}` and `{key}` with the endpoint and key values from your Azure portal Azure AI Services instance.
91-
2. Replace `{requestId}` with the `requestId` returned from the `POST` request.
100+
2. Replace `{resultId}` with the `resultId` from the `POST` response.
92101

93102
#### GET Request
94103
```bash
95-
curl -i -X GET "{endpoint}/contentunderstanding/analyzerResults/{requestId}?api-version=2025-05-01-preview" \
104+
curl -i -X GET "{endpoint}/contentunderstanding/analyzerResults/{resultId}?api-version=2025-05-01-preview" \
96105
-H "Ocp-Apim-Subscription-Key: {key}"
97106
```
98107

@@ -142,41 +151,20 @@ The 200 (`OK`) JSON response includes a `status` field indicating the status of
142151

143152
```json
144153
{
145-
"id": "1f8f3fe5-831b-4c3f-85a9-98a90e1af11b",
154+
"id": {resultId},
146155
"status": "Succeeded",
147156
"result": {
148157
"analyzerId": "prebuilt-imageAnalyzer",
149158
"apiVersion": "2025-05-01-preview",
150-
"createdAt": "2025-05-05T18:02:32Z",
159+
"createdAt": "YYYY-MM-DDTHH:MM:SSZ",
151160
"warnings": [],
152161
"contents": [
153-
{
154-
"markdown": "50-60 hours 36.6%\n\n60+ hours 37.8%\n\n40-50 hours 18.9%\n\n1-39 hours 6.7%\n",
155-
"fields": {
156-
"Summary": {
157-
"type": "string",
158-
"valueString": "The image is a pie chart that represents the distribution of hours worked per week by individuals. It is divided into four segments: 60+ hours (37.8%), 50-60 hours (36.6%), 40-50 hours (18.9%), and 1-39 hours (6.7%)."
159-
}
160-
},
161-
"kind": "document",
162-
"startPageNumber": 1,
163-
"endPageNumber": 1,
164-
"unit": "pixel",
165-
"pages": [
166-
{
167-
"pageNumber": 1,
168-
"angle": 0.1013839,
169-
"width": 1283,
170-
"height": 617
171-
}
172-
]
173-
},
174162
{
175163
"markdown": "![image](image)\n",
176164
"fields": {
177165
"Summary": {
178166
"type": "string",
179-
"valueString": "The image is a pie chart that represents the distribution of hours worked per week by individuals. It is divided into four segments: 60+ hours (37.8%), 50-60 hours (36.6%), 40-50 hours (18.9%), and 1-39 hours (6.7%)."
167+
"valueString": "The image is a pie chart depicting the distribution of hours worked per week among a group of individuals. The chart is divided into four segments: 60+ hours (37.8%), 50-60 hours (36.6%), 40-50 hours (18.9%), and 1-39 hours (6.7%). Each segment is labeled with its corresponding percentage and color-coded for clarity."
180168
}
181169
},
182170
"kind": "document",
@@ -185,7 +173,8 @@ The 200 (`OK`) JSON response includes a `status` field indicating the status of
185173
"unit": "pixel",
186174
"pages": [
187175
{
188-
"pageNumber": 1
176+
"pageNumber": 1,
177+
"spans": []
189178
}
190179
]
191180
}
@@ -247,6 +236,6 @@ The 200 (`OK`) JSON response includes a `status` field indicating the status of
247236

248237
## Next steps
249238

250-
* In this quickstart, you learned how to call the [REST API](<Reference Link>) using a pre-built analyzer. See how you can [customize pre-built analyzers](<Link to customization) to better fit your use case.
239+
* In this quickstart, you learned how to call the [REST API](REFERENCE LINK) using a pre-built analyzer. See how you can [customize pre-built analyzers](LINK TO CUSTOMIZATION) to better fit your use case.
251240

252241

0 commit comments

Comments
 (0)