-
Notifications
You must be signed in to change notification settings - Fork 2
/
DAS Tutorial.postman_collection.json
770 lines (770 loc) · 19.9 KB
/
DAS Tutorial.postman_collection.json
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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
{
"info": {
"_postman_id": "0341dc83-ec6a-428c-8412-f7575d004334",
"name": "DAS Tutorial",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "1- Authenticate",
"event": [
{
"listen": "test",
"script": {
"id": "3df16796-5a03-47e5-a63f-00989847157c",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"accessToken\", body[\"access_token\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "client_id",
"value": "",
"type": "text"
},
{
"key": "client_secret",
"value": "",
"type": "text"
},
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
},
{
"key": "scope",
"value": "code:all data:write data:read bucket:create bucket:delete",
"type": "text"
}
]
},
"url": {
"raw": "https://developer.api.autodesk.com/authentication/v1/authenticate",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"authentication",
"v1",
"authenticate"
]
},
"description": "This request to the Authentication API will obtain a token with the scope require for this tutorial. \r\nThis token will be used by all the subsequent request inside the \"Authorization\" header to identify your forge app.\r\nThis token will expire after one hour so you might need to execute the request again to get a new token if your expire.\r\n\r\nBefore executing this request, you will need to enter the forge app client id and client secret that was obtained by following the \"Creating ForgeApp\" section of this readme.md inside the body of the request.\r\nOnce the request is completed, postman will save the access_token received in the body response inside a variable named \"accessToken\" to be reused in the subsequent requests."
},
"response": []
},
{
"name": "2- Create activity",
"event": [
{
"listen": "test",
"script": {
"id": "b2642d8f-273b-4601-a1c0-150950b79ae4",
"exec": [
"var body = JSON.parse(pm.request.body);",
"postman.setGlobalVariable(\"activityName\", body[\"id\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"id\": \"executeScript\",\n \"commandLine\": \"\\\"$(engine.path)/3dsmaxbatch.exe\\\" -sceneFile \\\"$(args[InputMaxScene].path)\\\" \\\"$(args[MaxscriptToExecute].path)\\\" -v 5\",\n \"description\": \"Execute a maxscript on a max file provided in a zip\",\n \"appbundles\": [\n \t],\n \"engine\" : \"Autodesk.3dsMax+2019\",\n \"parameters\": {\n \t\"InputMaxScene\": {\n \"zip\": false,\n \"ondemand\": false,\n \"verb\": \"get\",\n \"description\": \"Input for providing the 3ds Max scene to be loaded before executing the script\",\n \"required\": true,\n \"localName\": \"workingFolder\"\n },\n \"MaxscriptToExecute\": {\n \"zip\": false,\n \"verb\": \"get\",\n \"description\": \"The maxscript to run using 3dsmaxbatch.exe\",\n \"ondemand\": false,\n \"required\": true,\n \"localName\": \"maxscriptToExecute.ms\"\n },\n \"OutputZip\": {\n \"zip\": true,\n \"ondemand\": false,\n \"verb\": \"put\",\n \"description\": \"Gather everything in the working folder inside a zip for output\",\n \"required\": true,\n \"localName\": \"workingFolder\"\n }\n }\n}"
},
"url": {
"raw": "https://developer.api.autodesk.com/da/us-east/v3/activities",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"da",
"us-east",
"v3",
"activities"
]
},
"description": "This request to the Design Automation V3 API will create an activity.\r\nIn design automation an activity specify an action that can be executed using a specified engine."
},
"response": []
},
{
"name": "3- Create activity alias",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"id\": \"tutorial\",\r\n \"version\": 1\r\n}"
},
"url": {
"raw": "https://developer.api.autodesk.com/da/us-east/v3/activities/{{activityName}}/aliases",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"da",
"us-east",
"v3",
"activities",
"{{activityName}}",
"aliases"
]
},
"description": "When submitting an activity to be executed to the Design Automation API V3, we must reference it by it's alias (see request 14). \r\nAn alias is like a tag that point to a particular version of an activity.\r\nThe version an alias point to can be changed in the future as develop more version of a given activity.\r\nThe request number 2 created the version 1 of our activity \"executeScript\".\r\nThis request will now create an alias named \"tutorial\" to reference version 1."
},
"response": []
},
{
"name": "4- Create OSS Bucket",
"event": [
{
"listen": "test",
"script": {
"id": "b8f08e2f-9a04-4e7f-a273-34119fb024cf",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"bucketKey\", body[\"bucketKey\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"bucketKey\": \"{{$guid}}\",\n\t\"access\": \"full\",\n\t\"policyKey\": \"temporary\"\n}\n"
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets"
]
},
"description": "This request to the Data Management API will create a bucket in the object storage service (OSS) that we will use to store our input zip file, input script file and our resulting zip file.\r\nThe bucket will be created with a random guid and the key to this bucket will be saved inside the \"bucketKey\" variable for sub-sequent request."
},
"response": []
},
{
"name": "5- Upload input zip file to OSS",
"event": [
{
"listen": "test",
"script": {
"id": "4bff56ac-f537-44ea-8154-d0012b635d52",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"zipFileObjectKey\", body[\"objectKey\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "file",
"file": {
"src": ""
}
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}/objects/{{$guid}}",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}",
"objects",
"{{$guid}}"
]
},
"description": "This request to the Data Management API will upload the input zip file containing the 3ds Max file to the object storage service (OSS).\r\nBefore sending the request you will need to select the file to be uploaded by pressing the \"Choose files\" button in the Body tab."
},
"response": []
},
{
"name": "6- Upload input script to OSS",
"event": [
{
"listen": "test",
"script": {
"id": "7d594927-c8cd-4a81-a867-f1dce464d1da",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"scriptFileObjectKey\", body[\"objectKey\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "file",
"file": {
"src": ""
}
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}/objects/{{$guid}}",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}",
"objects",
"{{$guid}}"
]
},
"description": "This request to the Data Management API will upload the input script file to the object storage service (OSS).\r\nBefore sending the request you will need to select the file to be uploaded by pressing the \"Choose files\" button in the Body tab."
},
"response": []
},
{
"name": "7- Get temporary download url for the input zip",
"event": [
{
"listen": "test",
"script": {
"id": "58eb33f6-d95a-4092-ba00-823348dec87a",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"zipFileSignedUrl\", body[\"signedUrl\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{}\n"
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}/objects/{{zipFileObjectKey}}/signed",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}",
"objects",
"{{zipFileObjectKey}}",
"signed"
]
},
"description": "This request to the Data Management API will create a temporary download url for the input zip file we uploaded to the Object Storage Service during request 5."
},
"response": []
},
{
"name": "8- Get temporary download url for the input script",
"event": [
{
"listen": "test",
"script": {
"id": "6bffc6b6-79f4-4e3f-92e9-3660d6b16802",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"scriptFileSignedUrl\", body[\"signedUrl\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{}\n"
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}/objects/{{scriptFileObjectKey}}/signed",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}",
"objects",
"{{scriptFileObjectKey}}",
"signed"
]
},
"description": "This request to the Data Management API will create a temporary download url for the script file we uploaded to the Object Storage Service during request 6."
},
"response": []
},
{
"name": "9- Get temporary upload url for the output zip",
"event": [
{
"listen": "prerequest",
"script": {
"id": "e2b1300a-e97d-4f23-be06-b2512e5c85e7",
"exec": [
"postman.setGlobalVariable(\"outputFileObjectKey\", \"outputFileObjectKey\");"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "a457bc30-9268-42c5-b79d-e992677be06d",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"outputFileSignedUrl\", body[\"signedUrl\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{}"
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}/objects/{{outputFileObjectKey}}/signed?access=readwrite",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}",
"objects",
"{{outputFileObjectKey}}",
"signed"
],
"query": [
{
"key": "access",
"value": "readwrite"
}
]
},
"description": "This request to the Data Management API will create a temporary upload url to the \"outputFileObjectKey\" in the Object Storage Service."
},
"response": []
},
{
"name": "10 - Get forge app nickame",
"event": [
{
"listen": "test",
"script": {
"id": "7cf9c997-7d7a-4f98-aadb-6880aa58e299",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"forgeAppNickname\", body);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://developer.api.autodesk.com/da/us-east/v3/forgeapps/me",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"da",
"us-east",
"v3",
"forgeapps",
"me"
]
},
"description": "This request will to the Design Automation V3 will request your forge app nickname from the Design Automation API."
},
"response": []
},
{
"name": "11- Send workitem",
"event": [
{
"listen": "test",
"script": {
"id": "7cf9c997-7d7a-4f98-aadb-6880aa58e299",
"exec": [
"var body = JSON.parse(responseBody);",
"postman.setGlobalVariable(\"workitemId\", body[\"id\"]);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"activityId\": \"{{forgeAppNickname}}.executeScript+tutorial\",\n\t\"arguments\": {\n\t\t\"InputMaxScene\": {\n \"url\": \"{{zipFileSignedUrl}}\",\n \"verb\": \"get\",\n \"pathInZip\": \"sceneName.max\"\n },\n \"MaxscriptToExecute\": {\n \t\"url\": \"{{scriptFileSignedUrl}}\",\n \"verb\": \"get\"\n },\n \"OutputZip\": {\n \t\"url\": \"{{outputFileSignedUrl}}\",\n \"verb\": \"put\"\n }\n\t}\n}"
},
"url": {
"raw": "https://developer.api.autodesk.com/da/us-east/v3/workitems",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"da",
"us-east",
"v3",
"workitems"
]
},
"description": "This request to the Design Automation V3 API will launch the execution of the activity that was created during the request number 2."
},
"response": []
},
{
"name": "12- Get workitem status",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"url": {
"raw": "https://developer.api.autodesk.com/da/us-east/v3/workitems/{{workitemId}}",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"da",
"us-east",
"v3",
"workitems",
"{{workitemId}}"
]
},
"description": "This request to the Design Automation API V3 will query the status of the work item."
},
"response": []
},
{
"name": "13- Download output from OSS",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{}"
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}/objects/{{outputFileObjectKey}}",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}",
"objects",
"{{outputFileObjectKey}}"
]
},
"description": "This request to the Data Management API will let you download the result zip file that have been uploaded by Design Automation to the Object Storage Service (OSS).\r\nTo save the result back to disk locally, press the download button once the response have been received."
},
"response": []
},
{
"name": "14- Delete forge app data in Design Automation",
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://developer.api.autodesk.com/da/us-east/v3/forgeapps/me",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"da",
"us-east",
"v3",
"forgeapps",
"me"
]
},
"description": "This request to the Design Automation V3 API will delete everything owned by your forge app inside the Design Automation V3 API."
},
"response": []
},
{
"name": "15- Delete OSS Bucket",
"event": [
{
"listen": "test",
"script": {
"id": "87cf6349-8950-428a-ae7a-59a5ff157444",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://developer.api.autodesk.com/oss/v2/buckets/{{bucketKey}}",
"protocol": "https",
"host": [
"developer",
"api",
"autodesk",
"com"
],
"path": [
"oss",
"v2",
"buckets",
"{{bucketKey}}"
]
},
"description": "This request to the Data Management API will delete the bucket that was created by request number 4 and every file that it contains."
},
"response": []
}
]
}