-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathinvoke_APIs.http
More file actions
460 lines (372 loc) · 13.8 KB
/
invoke_APIs.http
File metadata and controls
460 lines (372 loc) · 13.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
#@baseUrl = http://localhost:8000
@baseUrl = https://containerapp-cpsapi.proudbeach-01741a45.westus2.azurecontainerapps.io
#######################
# Variables
#######################
#@service_url = "https://cps-processorapi.gentleforest-27265674.eastus2.azurecontainerapps.io"
# Replace these with schema IDs from `/schemavault/`.
@schemaIdClaim = 0f886aad-6317-4806-bc8a-e7ad1fda64d5
@schemaIdPoliceReport = 84c6889f-1a43-43ed-93b3-4cf44e8a44dd
@schemaIdRepairEstimate = efcd50a4-c3e6-49cd-a88c-be342a269d39
@schemaIdDamagePhoto = 5fb7d528-3ea4-42a8-8a19-ab347ddd9ce0
####################
# Container App - Startup, liveness, health check probe api
####################
GET {{baseUrl}}/startup
#############################
# Get All Registered Schemas
##############################
GET {{baseUrl}}/schemavault/ HTTP/1.1
###############################
# Get All Registered Schema Sets
###############################
GET {{baseUrl}}/schemasetvault/ HTTP/1.1
#################################
# Batch Upload (recommended flow)
#################################
# 1) Create a batch (/batches)
# 2) Upload each file independently to /submit with batch_id + batch_item_id
# @name createBatch
PUT {{baseUrl}}/claimprocessor/claims HTTP/1.1
Content-Type: application/json
{
"schema_collection_id": "2e11a95f-fbcb-4628-a67e-5e0152477f54",
"metadata_id": "Batch Meta 001"
}
###
GET {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/manifest HTTP/1.1
###
DELETE {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}} HTTP/1.1
###
DELETE {{baseUrl}}/claimprocessor/claims/64425e64-d08d-4fdd-b86a-cf389f6dcff7 HTTP/1.1
################################################################################################################################################
Upload Batch Case 1 - autocliam with 4 items (claim form, police report, repair estimate, damage photo)
#########################################
# Upload File to existing claim
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchFileBoundary
------CPSBatchFileBoundary
Content-Disposition: form-data; name="file"; filename="Contoso Auto Claim Example.pdf"
Content-Type: application/pdf
< ../samples/autoclaim/Contoso Auto Claim Example.pdf
------CPSBatchFileBoundary
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdClaim}}"
}
------CPSBatchFileBoundary--
###
# Upload 2nd File to existing batch
##################################
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchFileBoundary
------CPSBatchFileBoundary
Content-Disposition: form-data; name="file"; filename="GA-20251128-CR.pdf"
Content-Type: application/pdf
< ../samples/autoclaim/GA-20251128-CR.pdf
------CPSBatchFileBoundary
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdPoliceReport}}"
}
------CPSBatchFileBoundary--
###
# Upload 3rd batch item
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchItemBoundary1
------CPSBatchItemBoundary1
Content-Disposition: form-data; name="file"; filename="RepairEstimate.pdf.pdf"
Content-Type: application/pdf
< ../samples/autoclaim/RepairEstimate.pdf
------CPSBatchItemBoundary1
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdRepairEstimate}}"
}
------CPSBatchItemBoundary1--
###
# Upload 4th batch item
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchItemBoundary2
------CPSBatchItemBoundary2
Content-Disposition: form-data; name="file"; filename="CamryDamage.png"
Content-Type: image/png
< ../samples/autoclaim/CamryDamage.png
------CPSBatchItemBoundary2
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdDamagePhoto}}"
}
------CPSBatchItemBoundary2--
################################################################################################################################################
Upload Batch Case 2 - autocliam_gap1 with 3 items (claim form, two damage photos)
#########################################
# Upload File to exiisting batch
##################################
#Upload Claim Document
##################################
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchItemBoundary
------CPSBatchItemBoundary
Content-Disposition: form-data; name="file"; filename="Claim.pdf"
Content-Type: application/pdf
< ../samples/autoclaim_gap1/Claim.pdf
------CPSBatchItemBoundary
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdClaim}}"
}
------CPSBatchItemBoundary--
##################################
# Upload Damage Photo 1
##################################
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchItemBoundary
------CPSBatchItemBoundary
Content-Disposition: form-data; name="file"; filename="Rear.png"
Content-Type: image/png
< ../samples/autoclaim_gap1/Rear.png
------CPSBatchItemBoundary
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdDamagePhoto}}"
}
------CPSBatchItemBoundary--
##################################
# Upload Damage Photo 2
##################################
POST {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/files HTTP/1.1
Content-Type: multipart/form-data; boundary=----CPSBatchItemBoundary
------CPSBatchItemBoundary
Content-Disposition: form-data; name="file"; filename="Rearandside.png"
Content-Type: image/png
< ../samples/autoclaim_gap1/Rearandside.png
------CPSBatchItemBoundary
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Claim_Id": "{{createBatch.response.body.$.claim_id}}",
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdDamagePhoto}}"
}
------CPSBatchItemBoundary--
########################
# Launch Claim Processing with Claim ID
########################
POST {{baseUrl}}/claimprocessor/claims HTTP/1.1
Content-Type: application/json
{
"claim_process_id": "{{createBatch.response.body.$.claim_id}}"
}
##################################
# Check Claim Processing Status
##################################
GET {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}}/status HTTP/1.1
###############################
# Get Processed Claim Detail
###############################
GET {{baseUrl}}/claimprocessor/claims/{{createBatch.response.body.$.claim_id}} HTTP/1.1
################################
# Show All Claim Processes (paginated) - No Summary, No Gap Analysis results for saving traffic
################################
POST {{baseUrl}}/claimprocessor/claims/processed HTTP/1.1
Content-Type: application/json
{
"page_size" : 100,
"page_number" : 1
}
####################################
# Delete Claim Processed Result
####################################
DELETE {{baseUrl}}/claimprocessor/claims/661a19a6-6b5c-43c7-a6c7-4e7c6c4c64d0 HTTP/1.1
#########################################################################
#v1 APIs
#################################
# Upload File for processing - claim form
#################################
# @name v1_submit
POST {{baseUrl}}/contentprocessor/submit HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="Contoso Auto Claim Example.pdf"
Content-Type: application/pdf
< ../samples/autoclaim/Contoso Auto Claim Example.pdf
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdClaim}}"
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--
##########
# @name process_monitor
GET {{baseUrl}}/contentprocessor/status/{{v1_submit.response.body.$.process_id}} HTTP/1.1
#################################
# Upload File for processing - police report
#################################
POST http://localhost:8000/contentprocessor/submit HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gk
------WebKitFormBoundary7MA4YWxkTrZu0gk
Content-Disposition: form-data; name="file"; filename="GA-20251128-CR.pdf"
Content-Type: application/pdf
< ../samples/autoclaim/GA-20251128-CR.pdf
------WebKitFormBoundary7MA4YWxkTrZu0gk
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdPoliceReport}}"
}
------WebKitFormBoundary7MA4YWxkTrZu0gk--
#################################
# Upload File for processing - Repair Estimation
#################################
POST http://localhost:8000/contentprocessor/submit HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gl
------WebKitFormBoundary7MA4YWxkTrZu0gl
Content-Disposition: form-data; name="file"; filename="RepairEstimate.pdf"
Content-Type: application/pdf
< ../samples/autoclaim/RepairEstimate.pdf
------WebKitFormBoundary7MA4YWxkTrZu0gl
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdRepairEstimate}}"
}
------WebKitFormBoundary7MA4YWxkTrZu0gl--
#################################
# Upload File for processing - Damage Photos
#################################
POST http://localhost:8000/contentprocessor/submit HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gm
------WebKitFormBoundary7MA4YWxkTrZu0gm
Content-Disposition: form-data; name="file"; filename="CamryDamage.png"
Content-Type: image/png
< ../samples/autoclaim/CamryDamage.png
------WebKitFormBoundary7MA4YWxkTrZu0gm
Content-Disposition: form-data; name="data"
Content-Type: application/json
{
"Metadata_Id": "Meta 001",
"Schema_Id": "{{schemaIdDamagePhoto}}"
}
------WebKitFormBoundary7MA4YWxkTrZu0gm--
#################################
# Get Status of processing
#################################
GET {{baseUrl}}/contentprocessor/status/d0407558-eed8-4f29-83fc-ee26f8e14e55 HTTP/1.1
#################################
# Get Processed Data
#################################
GET http://localhost:8000/contentprocessor/processed/d50bbfd1-64af-421a-bbcf-48be23ff1d28 HTTP/1.1
#################################
# Get Processed Step Data
#################################
GET http://localhost:8000/contentprocessor/processed/af251bef-0da8-4022-8d79-a7f723b1cba0/steps HTTP/1.1
###############################
# Download Origital file
###############################
GET http://localhost:8000/contentprocessor/processed/files/7b543f0e-3535-4566-baec-0f20ad06f4dc HTTP/1.1
#################################
# Get All Processed Data
#################################
POST http://localhost:8000/contentprocessor/processed HTTP/1.1
Content-Type: application/json
{
"page_size" : 20,
"page_number" : 1
}
#################################
# Add Comment on Processed Result
#################################
PUT http://localhost:8000/contentprocessor/processed/e8b7af31-1033-42cf-b7c4-c3d2f27a59d7 HTTP/1.1
Content-Type: application/json
{
"process_id" : "e8b7af31-1033-42cf-b7c4-c3d2f27a59d7",
"comment" : "Good morning Brittnee!"
}
#################################
# Modify Processed Result
#################################
PUT http://localhost:8000/contentprocessor/processed/e8b7af31-1033-42cf-b7c4-c3d2f27a59d7 HTTP/1.1
Content-Type: application/json
{
"process_id" : "e8b7af31-1033-42cf-b7c4-c3d2f27a59d7",
"modified_result" : {
"customer_name": "Brittnee Co. LTD",
"customer_address": {
"street": "PUSHPARAJ CHOWK",
"city": "SANGLI",
"state": "Maharashtra",
"postal_code": null,
"country": "India"
},
"customer_tax_id": "27AAFCA0924K1ZR",
"shipping_address": null,
"purchase_order": null,
"invoice_id": "GTI5153",
"invoice_date": "2019-02-27",
"payable_by": "2019-03-18",
"vendor_name": "DILIP TYRES",
"vendor_address": {
"street": "PUSHPARAJ CHOWK",
"city": "SANGLI",
"state": "Maharashtra",
"postal_code": null,
"country": "India"
},
"vendor_tax_id": "27AAEPH8682F1ZI",
"remittance_address": null,
"subtotal": 2287.5,
"total_discount": 0.0,
"total_tax": 640.5,
"invoice_total": 2928.0,
"payment_terms": "Net 20",
"items": [
{
"product_code": "40111090",
"description": "165.80R/14 ASSURANCE DP T/L TYRES",
"quantity": 1,
"tax": 640.5,
"tax_rate": "14%",
"unit_price": 2287.5,
"total": 2928.0,
"reason": null
}
],
"total_item_quantity": 1.0,
"items_customer_signature": {
"signatory": null,
"is_signed": null
},
"items_vendor_signature": {
"signatory": "Authorised Signatory",
"is_signed": true
},
"returns": null,
"total_return_quantity": 0.0,
"returns_customer_signature": null,
"returns_vendor_signature": null
}
}
#################################