-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathcards-scripted.json
2335 lines (2335 loc) · 162 KB
/
cards-scripted.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
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"info": {
"_postman_id": "d60f3402-4225-4410-8f6f-df0294f0c31a",
"name": "Webex Cards",
"description": "# Give new levels of interactivity to Webex Teams users with cards\r\n\r\nCards let you add interactivity to Webex Teams messages. Users can interact with your app in rich new ways without ever leaving the Webex Teams client.\r\n\r\nBots and Integrations can add cards to Webex Teams spaces by including a card attachment when posting a message. Card attachments use Microsoft's Adaptive Cards specification to define the content of the card. The Webex Teams clients render cards with the same look and feel across every platform, letting you focus on the content and the interaction without worrying about the presentation.\r\n\r\n## Cards and Action\r\n\r\nCards are created by including an adaptive card attachment when posting a new message. Cards can be interactive, soliciting an action from the user, such as submitting a response to a poll; or they may be purely informational, such as displaying current weather conditions.\r\n\r\nTo make cards interactive, include actions. Actions are buttons that users can use to open a URL, show another card, or submit data from an input form within the card. Cards may include up to five actions. If you include an input form, data submitted by a user is encrypted and stored within the Webex platform. You can use webhooks to receive notifications for new form submissions. Just like other API resources that contain encrypted data, the webhook's body will not include the form submission. After you receive the webhook, you will need to retrieve the form data via the Attachment Actions API endpoint. See Handling Requests from Webex Teams in the Webhooks Guide for more information about how to use webhooks with encrypted data.\r\n\r\nhttps://developer.webex.com/docs/api/guides/cards",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "AttachmentActions (user)",
"item": [
{
"name": "Create a room (for test run purpose)",
"event": [
{
"listen": "test",
"script": {
"id": "a7e1037b-b2f8-42d0-832b-2f639ac82cec",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a room: failed\"] = false",
"}",
"else {",
" tests[\"Create a room: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a room: cannot retreive identifier\"] = false",
" }",
" else {",
" var roomID = jsonData.id;",
" postman.setEnvironmentVariable(\"_room\", roomID);",
" tests[\"Create a room: created with id:\" + roomID] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"Testing Cards\"\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/rooms",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"rooms"
]
},
"description": "Creates a temp space that will be used to add a user, post a card, have the user submit actions and retrieve the submitted data via a webhook"
},
"response": []
},
{
"name": "Create a message (with card attached)",
"event": [
{
"listen": "test",
"script": {
"id": "16d66732-f888-4d2d-9255-ccd117c2f26b",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a message: failed\"] = false",
"}",
"else {",
" tests[\"Create a message: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a message: cannot retreive identifier\"] = false",
" }",
" else {",
" var messageID = jsonData.id;",
" postman.setEnvironmentVariable(\"_message\", messageID);",
" tests[\"Create a message: created with id:\" + messageID] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"roomId\": \"{{_room}}\",\n \"markdown\": \"[Learn more](https://adaptivecards.io) about Adaptive Cards.\",\n \"attachments\": [\n {\n \"contentType\": \"application/vnd.microsoft.card.adaptive\",\n \"content\": {\n \"type\": \"AdaptiveCard\",\n \"version\": \"1.0\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"Please enter your name:\"\n },\n {\n \"type\": \"Input.Text\",\n \"id\": \"name\",\n \"title\": \"New Input.Toggle\",\n \"placeholder\": \"name\"\n }\n ],\n \"actions\": [\n {\n \"type\": \"Action.Submit\",\n \"title\": \"Submit\"\n }\n ]\n }\n }\n ]\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/messages",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"messages"
]
},
"description": "Posts a plain text or markdown message, and optionally, a media content attachment, to a room.\n\nhttps://developer.webex.com/endpoint-messages-post.html"
},
"response": []
},
{
"name": "Create an attachmentAction (submit)",
"event": [
{
"listen": "test",
"script": {
"id": "76c60d74-7c18-4802-8274-d31c30424f19",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create an attachmentAction: failed\"] = false",
"}",
"else {",
" tests[\"Create an attachmentAction: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create an attachmentAction: cannot retreive identifier\"] = false",
" }",
" else {",
" var actionId = jsonData.id;",
" postman.setEnvironmentVariable(\"_action\", actionId);",
" tests[\"Create an attachmentAction: created with id:\" + actionId] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"type\": \"submit\",\r\n \"messageId\": \"{{_message}}\",\r\n \"inputs\": {\r\n \"name\": \"John Doe\"\r\n }\r\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/attachment/actions",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"attachment",
"actions"
]
},
"description": "Create a new attachment action.\n\nhttps://developer.webex.com/docs/api/v1/attachment-actions/create-an-attachment-action"
},
"response": []
},
{
"name": "Get attachmentAction details",
"event": [
{
"listen": "test",
"script": {
"id": "76c60d74-7c18-4802-8274-d31c30424f19",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{WEBEXAPI}}/attachment/actions/{{_action}}",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"attachment",
"actions",
"{{_action}}"
]
},
"description": "Shows details for a attachment action, by ID.\r\n\r\nSpecify the attachment action ID in the id URI parameter.\r\n\r\nhttps://developer.webex.com/docs/api/v1/attachment-actions/get-attachment-action-details"
},
"response": []
},
{
"name": "Delete a message",
"event": [
{
"listen": "test",
"script": {
"id": "47eb5bba-432b-47b3-883c-19b299496613",
"exec": [
"if (responseCode.code != 204) {",
" tests[\"Delete a message: failed\"] = false",
"}",
"else {",
" tests[\"Delete a message: success\"] = true",
"}",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{WEBEXAPI}}/messages/{{_message}}",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"messages",
"{{_message}}"
]
},
"description": "Deletes a message, by message ID.\n\nSpecify the message ID in the messageId parameter in the URI.\n\nhttps://developer.webex.com/endpoint-messages-messageId-delete.html"
},
"response": []
},
{
"name": "Delete room",
"event": [
{
"listen": "test",
"script": {
"id": "47711faa-4839-4007-b9d6-68b16fdacd3c",
"exec": [
"if (responseCode.code != 204) {",
" tests[\"Delete a room: failed\"] = false",
"}",
"else {",
" tests[\"Delete a room: success\"] = true",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{WEBEXAPI}}/rooms/{{_room}}",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"rooms",
"{{_room}}"
]
},
"description": "Deletes a room, by ID.\r\n\r\nSpecify the room ID in the roomId parameter in the URI.\r\n\r\nhttps://developer.webex.com/endpoint-rooms-roomId-delete.html"
},
"response": []
}
],
"description": "Users create attachment actions by interacting with message attachments such as clicking on a submit button in a card.\n\nhttps://developer.webex.com/docs/api/v1/attachment-actions",
"event": [
{
"listen": "prerequest",
"script": {
"id": "98329e3e-0093-404d-82c2-60d6547a7b55",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "4d14c21d-6c0c-4862-a526-0bd266470418",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"protocolProfileBehavior": {}
},
{
"name": "AttachmentActions (bot)",
"item": [
{
"name": "[bot] Get person details",
"event": [
{
"listen": "test",
"script": {
"id": "522373cb-8b1c-4492-8e81-be79e9d82157",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Get bot details: failed\"] = false",
"}",
"else {",
" tests[\"Get bot details: ok\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.type === undefined) {",
" tests[\"Get bot details: cannot retreive type\"] = false",
" }",
" else {",
" if (jsonData.type !== 'bot') {",
" tests[\"Get bot details: not a bot! please check your 'bot_token' env variable\"] = false",
" }",
" else {",
" tests[\"Get bot details: all good, bot token detected\"] = true;",
" }",
" }",
"",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
}
],
"url": {
"raw": "{{WEBEXAPI}}/people/me",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"people",
"me"
]
}
},
"response": []
},
{
"name": "[bot] Create a space (for test purpose)",
"event": [
{
"listen": "test",
"script": {
"id": "a7e1037b-b2f8-42d0-832b-2f639ac82cec",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a room: failed\"] = false",
"}",
"else {",
" tests[\"Create a room: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a room: cannot retreive identifier\"] = false",
" }",
" else {",
" var roomID = jsonData.id;",
" postman.setEnvironmentVariable(\"_room\", roomID);",
" tests[\"Create a room: created with id:\" + roomID] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"Testing Cards\"\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/rooms",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"rooms"
]
},
"description": "Creates a temp space that will be used to add a user, post a card, have the user submit actions and retrieve the submitted data via a webhook"
},
"response": []
},
{
"name": "[bot] Create a webhook (attachmentActions)",
"event": [
{
"listen": "test",
"script": {
"id": "28fcba06-c516-4b09-912c-611b385633c8",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a webhook: failed\"] = false",
"}",
"else {",
" tests[\"Create a webhook: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a webhook: cannot retreive webhook identifier\"] = false",
" }",
" else {",
" var webhookId = jsonData.id;",
" postman.setEnvironmentVariable(\"_webhook\", webhookId);",
" tests[\"Create a webhook: created with id:\" + webhookId] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"AttachmentActions Test from Postman\",\n \"resource\": \"attachmentActions\",\n \"event\": \"created\",\n \"filter\": \"roomId={{_room}}\",\n \"targetUrl\": \"https://en87plexda2ac.x.pipedream.net/\",\n \"secret\": \"not THAT secret\"\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/webhooks",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"webhooks"
]
}
},
"response": []
},
{
"name": "[bot] List webhooks",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
}
],
"url": {
"raw": "{{WEBEXAPI}}/webhooks",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"webhooks"
]
},
"description": "Lists all of your webhooks.\n\nhttps://developer.webex.com/endpoint-webhooks-get.html"
},
"response": []
},
{
"name": "[user] Get person details",
"event": [
{
"listen": "test",
"script": {
"id": "522373cb-8b1c-4492-8e81-be79e9d82157",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Get my details: failed\"] = false",
"}",
"else {",
" tests[\"Get my details: ok\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Get my details: cannot retreive identifier\"] = false",
" }",
" else {",
" // set _user env variable",
" var userId = jsonData.id;",
" postman.setEnvironmentVariable(\"_user\", userId);",
" tests[\"Get my details: fetched id:\" + userId] = true;",
" ",
" // set _uuid env variable",
" var decoded = Buffer.from(userId, 'base64');",
" var uuid = decoded.toString().substring(23);",
" postman.setEnvironmentVariable(\"_uuid\", uuid);",
" tests[\"Get my details: fetched uuid:\" + uuid] = true;",
"",
" }",
"",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{WEBEXAPI}}/people/me",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"people",
"me"
]
}
},
"response": []
},
{
"name": "[bot] Create a membership (add user)",
"event": [
{
"listen": "test",
"script": {
"id": "85684a2e-c68c-4e06-b205-be3a85140a4e",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a membership: failed\"] = false",
"}",
"else {",
" tests[\"Create a membership: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a membership: cannot retreive identifier\"] = false",
" }",
" else {",
" var membershipID = jsonData.id;",
" postman.setEnvironmentVariable(\"_membership\", membershipID);",
" tests[\"Create a membership: created with id:\" + membershipID] = true",
" }",
"}",
" ",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"roomId\" : \"{{_room}}\",\r\n \"personId\": \"{{_user}}\",\r\n \"isModerator\": false\r\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/memberships",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"memberships"
]
}
},
"response": []
},
{
"name": "[bot] Create a message (with card)",
"event": [
{
"listen": "test",
"script": {
"id": "16d66732-f888-4d2d-9255-ccd117c2f26b",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a message: failed\"] = false",
"}",
"else {",
" tests[\"Create a message: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a message: cannot retreive identifier\"] = false",
" }",
" else {",
" var messageID = jsonData.id;",
" postman.setEnvironmentVariable(\"_message\", messageID);",
" tests[\"Create a message: created with id:\" + messageID] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"roomId\": \"{{_room}}\",\n \"markdown\": \"[Stève at Post/Con](https://www.getpostman.com/post-con-2019/)\",\n \"attachments\": [\n {\n \"contentType\": \"application/vnd.microsoft.card.adaptive\",\n \"content\": {\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\n \"type\": \"AdaptiveCard\",\n \"version\": \"1.0\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"size\": \"Medium\",\n \"weight\": \"Bolder\",\n \"text\": \"API Emulators as an emerging Best Practice\"\n },\n {\n \"type\": \"ColumnSet\",\n \"columns\": [\n {\n \"type\": \"Column\",\n \"items\": [\n {\n \"type\": \"Image\",\n \"style\": \"Person\",\n \"url\": \"https://www.getpostman.com/img/pages/post-con-2019/_post-con-speakers/steve-sfartz.jpg\",\n \"size\": \"Small\"\n }\n ],\n \"width\": \"auto\"\n },\n {\n \"type\": \"Column\",\n \"items\": [\n {\n \"type\": \"TextBlock\",\n \"weight\": \"Bolder\",\n \"text\": \"Stève Sfartz\",\n \"wrap\": true\n },\n {\n \"type\": \"TextBlock\",\n \"spacing\": \"None\",\n \"text\": \"API Architect at Cisco\",\n \"isSubtle\": true,\n \"wrap\": true\n }\n ],\n \"width\": \"stretch\"\n }\n ]\n },\n {\n \"type\": \"TextBlock\",\n \"text\": \"Modern applications are highly distributed. We face challenges related to the use of internal and external APIs and how to build APIs with agility in the face of software that can evolve and change at any time. The API industry proposes two common strategies to circumvent these challenges: API Mocking and Service Virtualization. At Cisco, we came up with the idea of API emulators has a third strategy.\\nIn this talk, I'll explain the motivation behind API emulators in the perspective of DevOps, CI/CD, Software Development, and serverless/microservices architectures.\",\n \"wrap\": true\n },\n {\n \"type\": \"FactSet\",\n \"facts\": [\n {\n \"title\": \"Track:\",\n \"value\": \"Design and Architecture\"\n },\n {\n \"title\": \"When:\",\n \"value\": \"Thursday, 11:45AM\"\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"type\": \"Action.ShowCard\",\n \"title\": \"Take survey\",\n \"card\": {\n \"type\": \"AdaptiveCard\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"What are you familiar with?\"\n },\n {\n \"type\": \"Input.ChoiceSet\",\n \"id\": \"survey\",\n \"isMultiSelect\": true,\n \"value\": \"1\",\n \"choices\": [\n {\n \"title\": \"API Mocks\",\n \"value\": \"1\"\n },\n {\n \"title\": \"API Emulators\",\n \"value\": \"2\"\n },\n {\n \"title\": \"Service Virtualization\",\n \"value\": \"3\"\n }\n ]\n },\n {\n \"type\": \"Input.Text\",\n \"placeholder\": \"enter comment\",\n \"style\": \"text\",\n \"maxLength\": 0,\n \"id\": \"comment\"\n }\n ],\n \"actions\": [\n {\n \"type\": \"Action.Submit\",\n \"title\": \"send\",\n \"data\": {\n \"id\": \"POST/CON 2019\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"Jobs at Cisco\",\n \"url\": \"https://jobs.cisco.com/jobs/SearchJobs/DevNet?3_109_3=%5B%22169482%22%5D&3_143_3=%5B%2212229389%22%5D\"\n },\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"Join DevNet\",\n \"url\": \"https://developer.cisco.com/appdev/\"\n }\n ]\n }\n }\n ]\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/messages",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"messages"
]
},
"description": "https://adaptivecards.io/samples/"
},
"response": []
},
{
"name": "[user] Get message (read card)",
"event": [
{
"listen": "test",
"script": {
"id": "16d66732-f888-4d2d-9255-ccd117c2f26b",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a message: failed\"] = false",
"}",
"else {",
" tests[\"Create a message: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a message: cannot retreive identifier\"] = false",
" }",
" else {",
" var messageID = jsonData.id;",
" postman.setEnvironmentVariable(\"_message\", messageID);",
" tests[\"Create a message: created with id:\" + messageID] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"roomId\": \"{{_room}}\",\n \"markdown\": \"[Stève at Post/Con](https://www.getpostman.com/post-con-2019/)\",\n \"attachments\": [\n {\n \"contentType\": \"application/vnd.microsoft.card.adaptive\",\n \"content\": {\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\n \"type\": \"AdaptiveCard\",\n \"version\": \"1.0\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"size\": \"Medium\",\n \"weight\": \"Bolder\",\n \"text\": \"API Emulators as an emerging Best Practice\"\n },\n {\n \"type\": \"ColumnSet\",\n \"columns\": [\n {\n \"type\": \"Column\",\n \"items\": [\n {\n \"type\": \"Image\",\n \"style\": \"Person\",\n \"url\": \"https://www.getpostman.com/img/pages/post-con-2019/_post-con-speakers/steve-sfartz.jpg\",\n \"size\": \"Small\"\n }\n ],\n \"width\": \"auto\"\n },\n {\n \"type\": \"Column\",\n \"items\": [\n {\n \"type\": \"TextBlock\",\n \"weight\": \"Bolder\",\n \"text\": \"Stève Sfartz\",\n \"wrap\": true\n },\n {\n \"type\": \"TextBlock\",\n \"spacing\": \"None\",\n \"text\": \"API Architect at Cisco DevNet\",\n \"isSubtle\": true,\n \"wrap\": true\n }\n ],\n \"width\": \"stretch\"\n }\n ]\n },\n {\n \"type\": \"TextBlock\",\n \"text\": \"Modern applications are highly distributed. We face challenges related to the use of internal and external APIs and how to build APIs with agility in the face of software that can evolve and change at any time. The API industry proposes two common strategies to circumvent these challenges: API Mocking and Service Virtualization. At Cisco, we came up with the idea of API emulators has a third strategy.\\nIn this talk, I'll explain the motivation behind API emulators in the perspective of DevOps, CI/CD, Software Development, and serverless/microservices architectures.\",\n \"wrap\": true\n },\n {\n \"type\": \"FactSet\",\n \"facts\": [\n {\n \"title\": \"Track:\",\n \"value\": \"Design and Architecture\"\n },\n {\n \"title\": \"When:\",\n \"value\": \"Thursday, 11:45AM\"\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"type\": \"Action.ShowCard\",\n \"title\": \"Take survey\",\n \"card\": {\n \"type\": \"AdaptiveCard\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"What are you familiar with?\"\n },\n {\n \"type\": \"Input.ChoiceSet\",\n \"id\": \"MultiSelectVal\",\n \"isMultiSelect\": true,\n \"value\": \"1\",\n \"choices\": [\n {\n \"title\": \"API Mocks\",\n \"value\": \"1\"\n },\n {\n \"title\": \"API Emulators\",\n \"value\": \"2\"\n },\n {\n \"title\": \"Service Virtualization\",\n \"value\": \"3\"\n }\n ]\n }\n ],\n \"actions\": [\n {\n \"type\": \"Action.Submit\",\n \"title\": \"send\",\n \"data\": {\n \"id\": \"1234567890\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"Check jobs\",\n \"url\": \"https://jobs.cisco.com/jobs/SearchJobs/DevNet?3_109_3=%5B%22169482%22%5D&3_143_3=%5B%2212229389%22%5D\"\n },\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"Join DevNet\",\n \"url\": \"https://developer.cisco.com/appdev/\"\n }\n ]\n }\n }\n ]\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/messages/{{_message}}",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"messages",
"{{_message}}"
]
}
},
"response": []
},
{
"name": "[user] Create an attachmentAction (submit)",
"event": [
{
"listen": "test",
"script": {
"id": "76c60d74-7c18-4802-8274-d31c30424f19",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create an attachmentAction: failed\"] = false",
"}",
"else {",
" tests[\"Create an attachmentAction: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create an attachmentAction: cannot retreive identifier\"] = false",
" }",
" else {",
" var actionId = jsonData.id;",
" postman.setEnvironmentVariable(\"_action\", actionId);",
" tests[\"Create an attachmentAction: created with id:\" + actionId] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"type\": \"submit\",\r\n \"messageId\": \"{{_message}}\",\r\n \"inputs\": {\r\n \"id\": \"POST/CON 2019\",\r\n \"survey\": \"1,3\",\r\n \"comment\": \"joining to learn more about emulators\"\r\n }\r\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/attachment/actions",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"attachment",
"actions"
]
},
"description": "Posts a plain text or markdown message, and optionally, a media content attachment, to a room.\n\nhttps://developer.webex.com/endpoint-messages-post.html"
},
"response": []
},
{
"name": "[bot] Get attachmentAction details (read inputs)",
"event": [
{
"listen": "test",
"script": {
"id": "76c60d74-7c18-4802-8274-d31c30424f19",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Get attachmentActions details: failed\"] = false",
"}",
"else {",
" tests[\"Get attachmentActions details: ok\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"attachmentActions: cannot retreive identifier\"] = false",
" }",
" else {",
" var inputs = jsonData.inputs;",
" postman.setEnvironmentVariable(\"_inputs_id\", inputs.id);",
" postman.setEnvironmentVariable(\"_inputs_survey\", inputs.comment);",
" tests[\"Get attachmentActions details: parsed survey \" + inputs.id] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{WEBEXAPI}}/attachment/actions/{{_action}}",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"attachment",
"actions",
"{{_action}}"
]
},
"description": "Posts a plain text or markdown message, and optionally, a media content attachment, to a room.\n\nhttps://developer.webex.com/endpoint-messages-post.html"
},
"response": []
},
{
"name": "[bot] Create a message (respond to user)",
"event": [
{
"listen": "test",
"script": {
"id": "16d66732-f888-4d2d-9255-ccd117c2f26b",
"exec": [
"if (responseCode.code != 200) {",
" tests[\"Create a message: failed\"] = false",
"}",
"else {",
" tests[\"Create a message: created\"] = true",
"",
" var jsonData = JSON.parse(responseBody);",
" if (jsonData.id === undefined) {",
" tests[\"Create a message: cannot retreive identifier\"] = false",
" }",
" else {",
" var messageID = jsonData.id;",
" postman.setEnvironmentVariable(\"_message\", messageID);",
" tests[\"Create a message: created with id:\" + messageID] = true",
" }",
"}",
" ",
" ",
" ",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bot_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"roomId\": \"{{_room}}\",\n \"markdown\": \"**Thanks for your feedback to '{{_inputs_id}}' survey**\\n\\n> comments:<br/> _{{_inputs_survey}}_\"\n}"
},
"url": {
"raw": "{{WEBEXAPI}}/messages",
"host": [
"{{WEBEXAPI}}"
],
"path": [
"messages"
]
},
"description": "https://adaptivecards.io/samples/"
},
"response": []