-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e398565
commit 7b403a8
Showing
3 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{ | ||
"id": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"name": "Cisco Spark API - Direct Rooms", | ||
"description": "create the 1-1 room between you and a fake Spark user (\"dummy\"), unless the _dummy env variable is set to a Spark account of your preference.", | ||
"order": [ | ||
"93c7f338-791b-4328-0ad7-9590b46995ca", | ||
"3ea810f3-701e-69f7-e02b-73fda58c5cf1", | ||
"04bceb9e-63d1-6ad1-dc2f-b1a8241c142b", | ||
"75792dee-ccb3-1044-b882-4ec14f7df3d8", | ||
"bc94c661-367f-eb9b-cd11-bd3e7ae4ec0e", | ||
"c7360517-cc8e-0441-09f0-d720a3802772" | ||
], | ||
"folders": [], | ||
"timestamp": 1476096951085, | ||
"owner": "30210", | ||
"public": false, | ||
"published": false, | ||
"requests": [ | ||
{ | ||
"id": "04bceb9e-63d1-6ad1-dc2f-b1a8241c142b", | ||
"headers": "Authorization: Bearer {{spark_token}}\n", | ||
"url": "https://api.ciscospark.com/v1/memberships?roomId={{_room}}", | ||
"preRequestScript": null, | ||
"pathVariables": {}, | ||
"method": "GET", | ||
"data": null, | ||
"dataMode": "params", | ||
"version": 2, | ||
"tests": "if (responseCode.code != 200) {\n tests[\"List rooms: failed\"] = false;\n}\nelse {\n tests[\"List rooms: success\"] = true;\n}", | ||
"currentHelper": "normal", | ||
"helperAttributes": {}, | ||
"time": 1467636707832, | ||
"name": "List memberships (for 1-1 room)", | ||
"description": "learning purpose only here: help understand what's happening on the Spark back-end.", | ||
"collectionId": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"responses": [] | ||
}, | ||
{ | ||
"id": "3ea810f3-701e-69f7-e02b-73fda58c5cf1", | ||
"headers": "Authorization: Bearer {{spark_token}}\n", | ||
"url": "https://api.ciscospark.com/v1/messages?roomId={{_room}}", | ||
"preRequestScript": null, | ||
"pathVariables": {}, | ||
"method": "GET", | ||
"data": null, | ||
"dataMode": "params", | ||
"version": 2, | ||
"tests": "if (responseCode.code != 200) {\n tests[\"List messages: failed\"] = false;\n}\nelse {\n tests[\"List messages: success\"] = true;\n}", | ||
"currentHelper": "normal", | ||
"helperAttributes": {}, | ||
"time": 1468373909144, | ||
"name": "List messages (in 1-1 room)", | ||
"description": "learning purpose only here: help understand what's happening on the Spark back-end.", | ||
"collectionId": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"responses": [] | ||
}, | ||
{ | ||
"id": "75792dee-ccb3-1044-b882-4ec14f7df3d8", | ||
"headers": "Authorization: Bearer {{spark_token}}\nContent-Type: application/json\n", | ||
"url": "https://api.ciscospark.com/v1/rooms/{{_room}}", | ||
"preRequestScript": null, | ||
"pathVariables": {}, | ||
"method": "DELETE", | ||
"data": [], | ||
"dataMode": "raw", | ||
"version": 2, | ||
"tests": "if (responseCode.code != 409) {\n tests[\"Delete a room: failed\"] = false\n}\nelse {\n tests[\"Delete a room: success\"] = true\n}", | ||
"currentHelper": "normal", | ||
"helperAttributes": {}, | ||
"time": 1476101157720, | ||
"name": "Delete a room (fails with 409)", | ||
"description": "As documented, this call will fails, as a 1-1 room cannot be removed.", | ||
"collectionId": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"responses": [], | ||
"rawModeData": "" | ||
}, | ||
{ | ||
"id": "93c7f338-791b-4328-0ad7-9590b46995ca", | ||
"headers": "Authorization: Bearer {{spark_token}}\nContent-Type: application/json\n", | ||
"url": "https://api.ciscospark.com/v1/messages", | ||
"preRequestScript": "var searchingFor = postman.getEnvironmentVariable(\"_dummy\");\nif (searchingFor === undefined) {\n postman.setEnvironmentVariable(\"_dummy\", \"dummy@sparkbot.io\");\n}", | ||
"pathVariables": {}, | ||
"method": "POST", | ||
"data": [], | ||
"dataMode": "raw", | ||
"version": 2, | ||
"tests": "if (responseCode.code != 200) {\n tests[\"Create 1-1 room: failed\"] = false\n}\nelse {\n tests[\"Create 1-1 room: room created\"] = true\n\n var jsonData = JSON.parse(responseBody);\n if (jsonData.id === undefined) {\n tests[\"Create 1-1 room: cannot retreive message info\"] = false\n }\n else {\n \n var roomId = jsonData.roomId;\n postman.setEnvironmentVariable(\"_room\", roomId);\n var messageId = jsonData.id;\n postman.setEnvironmentVariable(\"_message\", messageId);\n var personId = jsonData.personId;\n postman.setEnvironmentVariable(\"_person\", personId);\n\n tests[\"Create 1-1 room: message created to person id:\" + personId] = true\n }\n}\n \n \n \n", | ||
"currentHelper": "normal", | ||
"helperAttributes": {}, | ||
"time": 1476103065893, | ||
"name": "Create a 1-1 room", | ||
"description": "To create a 1-1 room, we post a message to a person Cisco Spark 's email.\n\nhttps://developer.ciscospark.com/endpoint-messages-post.html", | ||
"collectionId": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"responses": [], | ||
"rawModeData": "{\r\n \"toPersonEmail\" : \"{{_dummy}}\",\r\n \"text\" : \"This message is sent to a person directly => will create a 1-1 room, and make you rejoin a pre-existing 1-1 room you've chosen to leave\"\r\n}" | ||
}, | ||
{ | ||
"id": "bc94c661-367f-eb9b-cd11-bd3e7ae4ec0e", | ||
"headers": "Authorization: Bearer {{spark_token}}\n", | ||
"url": "https://api.ciscospark.com/v1/memberships?roomId={{_room}}", | ||
"preRequestScript": null, | ||
"pathVariables": {}, | ||
"method": "GET", | ||
"data": null, | ||
"dataMode": "params", | ||
"version": 2, | ||
"tests": "if (responseCode.code != 200) {\n tests[\"Extract membership: failed\"] = false;\n}\nelse {\n \n var jsonData = JSON.parse(responseBody);\n if (jsonData.items === undefined) {\n tests[\"Extract membership: cannot retreive memberships\"] = false\n }\n else {\n \n var members = jsonData.items;\n var searchingFor = postman.getEnvironmentVariable(\"_person\");\n var found = \"\";\n for (i = 0; i < members.length; i++) {\n var member = members[i];\n if (member.personId === searchingFor) {\n found = member.id;\n }\n }\n \n postman.setEnvironmentVariable(\"_membership\", found);\n\n tests[\"Extract membership: found:\" + found] = true\n }\n}\n", | ||
"currentHelper": "normal", | ||
"helperAttributes": {}, | ||
"time": 1476103457256, | ||
"name": "Extract membership", | ||
"description": "List 1-1 memberships, and extracts your membership identifier", | ||
"collectionId": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"responses": [] | ||
}, | ||
{ | ||
"id": "c7360517-cc8e-0441-09f0-d720a3802772", | ||
"headers": "Authorization: Bearer {{spark_token}}\nContent-Type: application/json\n", | ||
"url": "https://api.ciscospark.com/v1/memberships/{{_membership}}", | ||
"preRequestScript": null, | ||
"pathVariables": {}, | ||
"method": "DELETE", | ||
"data": [], | ||
"dataMode": "raw", | ||
"version": 2, | ||
"tests": "if (responseCode.code != 204) {\n tests[\"Delete a membership: failed\"] = false\n}\nelse {\n tests[\"Delete a membership: success\"] = true\n}", | ||
"currentHelper": "normal", | ||
"helperAttributes": {}, | ||
"time": 1467637347609, | ||
"name": "Delete membership (fails with 409)", | ||
"description": "Leaves the room we joined in the first call when we sent the direct message.\r\n\r\nThis Fails with 409 as the Spark API does not support this feature for now.\r\n\r\nLeaving a room is only possible via the Spark clients.", | ||
"collectionId": "26b564a2-e39e-00a0-8df4-430272daf8cc", | ||
"responses": [], | ||
"rawModeData": "" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.