Skip to content

Commit 106273c

Browse files
committed
Update use-rest-api.md examples.
1 parent e1acc0d commit 106273c

File tree

1 file changed

+133
-109
lines changed

1 file changed

+133
-109
lines changed

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

Lines changed: 133 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,23 @@ First, create a JSON file named `request_body.json` with the following content:
5555
"fields": {
5656
"VendorName": {
5757
"type": "string",
58-
"kind": "extract",
58+
"method": "extract",
5959
"description": "Vendor issuing the invoice"
6060
},
6161
"Items": {
6262
"type": "array",
63+
"method": "extract",
6364
"items": {
6465
"type": "object",
6566
"properties": {
6667
"Description": {
6768
"type": "string",
68-
"kind": "extract",
69+
"method": "extract",
6970
"description": "Description of the item"
7071
},
7172
"Amount": {
7273
"type": "number",
73-
"kind": "extract",
74+
"method": "extract",
7475
"description": "Amount of the item"
7576
}
7677
}
@@ -166,11 +167,7 @@ First, create a JSON file named `request_body.json` with the following content:
166167
"Sentiment": {
167168
"type": "string",
168169
"method": "classify",
169-
"enum": [
170-
"Positive",
171-
"Neutral",
172-
"Negative"
173-
]
170+
"enum": [ "Positive", "Neutral", "Negative" ]
174171
}
175172
}
176173
}
@@ -226,19 +223,19 @@ Before running the cURL command, make the following changes to the HTTP request:
226223

227224
1. Replace `{endpoint}` and `{key}` with the endpoint and key values from your Azure portal Azure AI Services instance.
228225
2. Replace `{analyzerId}` with the name of the custom analyzer created earlier.
229-
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 the sample URL `TODO`.
226+
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).
230227

231228
# [Audio](#tab/audio)
232229

233230
1. Replace `{endpoint}` and `{key}` with the endpoint and key values from your Azure portal Azure AI Services instance.
234231
2. Replace `{analyzerId}` with the name of the custom analyzer created earlier.
235-
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 the sample URL `TODO`.
232+
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).
236233

237234
# [Video](#tab/video)
238235

239236
1. Replace `{endpoint}` and `{key}` with the endpoint and key values from your Azure portal Azure AI Services instance.
240237
2. Replace `{analyzerId}` with the name of the custom analyzer created earlier.
241-
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 the sample URL `TODO`.
238+
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).
242239

243240
---
244241

@@ -283,41 +280,61 @@ You will receive a 200 (OK) JSON response with a `status` field indicating the s
283280

284281
```json
285282
{
286-
"id": "3b31320d-8bab-4f88-b19c-2322a7f11034",
283+
"id": "f87e468b-d96b-488c-a646-33cc5823972f",
287284
"status": "Succeeded",
288285
"result": {
289-
"analyzerId": "myInvoice",
286+
"analyzerId": "sample_invoice_analyzer",
290287
"apiVersion": "2024-12-01-preview",
291-
"createdAt": "2024-10-14T18:46:36Z",
292-
"stringEncoding": "codePoint",
288+
"createdAt": "2024-11-09T08:36:31Z",
293289
"contents": [
294290
{
291+
"markdown": "CONTOSO LTD.\n\n\n# INVOICE\n\nContoso Headquarters...",
292+
"fields": {
293+
"VendorName": {
294+
"type": "string",
295+
"valueString": "CONTOSO LTD.",
296+
"spans": [ { "offset": 0, "length": 12 } ],
297+
"confidence": 0.941,
298+
"source": "D(1,0.5729,0.6582,2.3353,0.6582,2.3353,0.8957,0.5729,0.8957)"
299+
},
300+
"Items": {
301+
"type": "array",
302+
"valueArray": [
303+
{
304+
"type": "object",
305+
"valueObject": {
306+
"Description": {
307+
"type": "string",
308+
"valueString": "Consulting Services",
309+
"spans": [ { "offset": 909, "length": 19 } ],
310+
"confidence": 0.971,
311+
"source": "D(1,2.3264,5.673,3.6413,5.673,3.6413,5.8402,2.3264,5.8402)"
312+
},
313+
"Amount": {
314+
"type": "number",
315+
"valueNumber": 60,
316+
"spans": [ { "offset": 995, "length": 6 }
317+
],
318+
"confidence": 0.988,
319+
"source": "D(1,7.4507,5.6684,7.9245,5.6684,7.9245,5.8323,7.4507,5.8323)"
320+
}
321+
}
322+
}, ...
323+
]
324+
}
325+
},
295326
"kind": "document",
296-
"markdown": "# CONTOSO LTD.\n\n...",
297327
"startPageNumber": 1,
298328
"endPageNumber": 1,
299329
"unit": "inch",
300330
"pages": [
301331
{
302332
"pageNumber": 1,
333+
"angle": -0.0039,
303334
"width": 8.5,
304335
"height": 11
305336
}
306-
],
307-
"fields": {
308-
"Company": {
309-
"type": "string",
310-
"valueString": "CONTOSO",
311-
"spans": [
312-
{
313-
"offset": 7,
314-
"length": 2
315-
}
316-
],
317-
"confidence": 0.95,
318-
"source": "D(1,5,1,7,1,7,1.5,5,1.5)"
319-
}
320-
}
337+
]
321338
}
322339
]
323340
}
@@ -328,41 +345,36 @@ You will receive a 200 (OK) JSON response with a `status` field indicating the s
328345

329346
```json
330347
{
331-
"id": "3b31320d-8bab-4f88-b19c-2322a7f11034",
348+
"id": "12fd421b-b545-4d63-93a5-01284081bbe1",
332349
"status": "Succeeded",
333350
"result": {
334-
"analyzerId": "myInvoice",
351+
"analyzerId": "sample_chart_analyzer",
335352
"apiVersion": "2024-12-01-preview",
336-
"createdAt": "2024-10-14T18:46:36Z",
337-
"stringEncoding": "codePoint",
353+
"createdAt": "2024-11-09T08:41:00Z",
338354
"contents": [
339355
{
356+
"markdown": "![image](image)\n",
357+
"fields": {
358+
"Title": {
359+
"type": "string",
360+
"valueString": "Weekly Work Hours Distribution"
361+
},
362+
"ChartType": {
363+
"type": "string",
364+
"valueString": "pie"
365+
}
366+
},
340367
"kind": "document",
341-
"markdown": "# CONTOSO LTD.\n\n...",
342368
"startPageNumber": 1,
343369
"endPageNumber": 1,
344-
"unit": "inch",
370+
"unit": "pixel",
345371
"pages": [
346372
{
347373
"pageNumber": 1,
348-
"width": 8.5,
349-
"height": 11
374+
"width": 1283,
375+
"height": 617
350376
}
351-
],
352-
"fields": {
353-
"Company": {
354-
"type": "string",
355-
"valueString": "CONTOSO",
356-
"spans": [
357-
{
358-
"offset": 7,
359-
"length": 2
360-
}
361-
],
362-
"confidence": 0.95,
363-
"source": "D(1,5,1,7,1,7,1.5,5,1.5)"
364-
}
365-
}
377+
]
366378
}
367379
]
368380
}
@@ -373,41 +385,63 @@ You will receive a 200 (OK) JSON response with a `status` field indicating the s
373385

374386
```json
375387
{
376-
"id": "3b31320d-8bab-4f88-b19c-2322a7f11034",
388+
"id": "247c369c-1aa5-4f92-b033-a8e4318e1c02",
377389
"status": "Succeeded",
378390
"result": {
379-
"analyzerId": "myInvoice",
391+
"analyzerId": "sample_chart_analyzer",
380392
"apiVersion": "2024-12-01-preview",
381-
"createdAt": "2024-10-14T18:46:36Z",
382-
"stringEncoding": "codePoint",
393+
"createdAt": "2024-11-09T08:42:58Z",
383394
"contents": [
384395
{
385-
"kind": "document",
386-
"markdown": "# CONTOSO LTD.\n\n...",
387-
"startPageNumber": 1,
388-
"endPageNumber": 1,
389-
"unit": "inch",
390-
"pages": [
391-
{
392-
"pageNumber": 1,
393-
"width": 8.5,
394-
"height": 11
395-
}
396-
],
396+
"kind": "audioVisual",
397+
"startTimeMs": 0,
398+
"endTimeMs": 32182,
399+
"markdown": "```WEBVTT\n\n00:00.080 --> 00:00.640\n<v Agent>Good day...",
397400
"fields": {
398-
"Company": {
401+
"Sentiment": {
399402
"type": "string",
400-
"valueString": "CONTOSO",
401-
"spans": [
403+
"valueString": "Positive"
404+
},
405+
"Summary": {
406+
"type": "string",
407+
"valueString": "Maria Smith contacted Contoso to inquire about her current point balance. Agent John Doe confirmed her identity and informed her that she has 599 points. Maria did not require any further information and the call ended on a positive note."
408+
},
409+
"People": {
410+
"type": "array",
411+
"valueArray": [
402412
{
403-
"offset": 7,
404-
"length": 2
405-
}
406-
],
407-
"confidence": 0.95,
408-
"source": "D(1,5,1,7,1,7,1.5,5,1.5)"
413+
"type": "object",
414+
"valueObject": {
415+
"Name": {
416+
"type": "string",
417+
"valueString": "Maria Smith"
418+
},
419+
"Role": {
420+
"type": "string",
421+
"valueString": "Customer"
422+
}
423+
}
424+
}, ...
425+
]
409426
}
410-
}
427+
},
428+
"transcriptPhrases": [
429+
{
430+
"speaker": "Agent 1",
431+
"startTimeMs": 80,
432+
"endTimeMs": 640,
433+
"text": "Good day.",
434+
"confidence": 0.932,
435+
"words": [
436+
{
437+
"startTimeMs": 80,
438+
"endTimeMs": 280,
439+
"text": "Good"
440+
}, ...
441+
],
442+
"locale": "en-US"
443+
}, ...
444+
]
411445
}
412446
]
413447
}
@@ -418,46 +452,36 @@ You will receive a 200 (OK) JSON response with a `status` field indicating the s
418452

419453
```json
420454
{
421-
"id": "3b31320d-8bab-4f88-b19c-2322a7f11034",
455+
"id": "204fb777-e961-4d6d-a6b1-6e02c773d72c",
422456
"status": "Succeeded",
423457
"result": {
424-
"analyzerId": "myInvoice",
458+
"analyzerId": "sample_marketing_video_analyzer",
425459
"apiVersion": "2024-12-01-preview",
426-
"createdAt": "2024-10-14T18:46:36Z",
427-
"stringEncoding": "codePoint",
460+
"createdAt": "2024-11-09T08:57:21Z",
461+
"warnings": [],
428462
"contents": [
429463
{
430-
"kind": "document",
431-
"markdown": "# CONTOSO LTD.\n\n...",
432-
"startPageNumber": 1,
433-
"endPageNumber": 1,
434-
"unit": "inch",
435-
"pages": [
436-
{
437-
"pageNumber": 1,
438-
"width": 8.5,
439-
"height": 11
440-
}
441-
],
464+
"kind": "audioVisual",
465+
"startTimeMs": 0,
466+
"endTimeMs": 2800,
467+
"width": 540,
468+
"height": 960,
469+
"markdown": "# Shot 0:0.0 => 0:2.800\n\n## Transcript\n\n```\n\nWEBVTT\n\n0:0.80 --> 0:10.560\n<v Speaker>When I was planning my trip...",
442470
"fields": {
443-
"Company": {
471+
"sentiment": {
444472
"type": "string",
445-
"valueString": "CONTOSO",
446-
"spans": [
447-
{
448-
"offset": 7,
449-
"length": 2
450-
}
451-
],
452-
"confidence": 0.95,
453-
"source": "D(1,5,1,7,1,7,1.5,5,1.5)"
473+
"valueString": "Neutral"
474+
},
475+
"description": {
476+
"type": "string",
477+
"valueString": "The video begins with a view from a glass floor, showing a person's feet in white sneakers standing on it. The scene captures a downward view of a structure, possibly a tower, with a grid pattern on the floor and a clear view of the ground below. The lighting is bright, suggesting a sunny day, and the colors are dominated by the orange of the structure and the gray of the floor."
454478
}
455479
}
456-
}
480+
},
481+
...
457482
]
458483
}
459-
}
460-
```
484+
}```
461485

462486
---
463487

0 commit comments

Comments
 (0)