Skip to content

Instantly share code, notes, and snippets.

@aaron-goff
Last active December 20, 2019 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaron-goff/64152b5162bc4c0003c1962d8f811d9e to your computer and use it in GitHub Desktop.
Save aaron-goff/64152b5162bc4c0003c1962d8f811d9e to your computer and use it in GitHub Desktop.
Postman Collection for interacting with a Roku Device
{
"id": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"name": "Roku",
"description": "",
"auth": null,
"events": null,
"variables": [],
"order": [
"250f1ee7-ffd8-4e79-ba0f-38a9f973ea79",
"2df25084-b163-435c-af34-c624fc99bf26",
"339e8a7a-6509-47b8-af53-2ce13e006872",
"4249ad17-63f1-4309-9496-1355d0ef9f41",
"450aae98-9f51-4552-b8ea-e66412a1838e",
"54097497-e25c-4bf0-b40c-64f5f937e28b",
"62ac607d-f018-419a-9707-813174dcff6e",
"641ebb18-9e70-4341-bc49-ef708eecb309",
"7699065d-36ba-4cff-a703-3e12143e5388",
"965382de-ba51-4cde-9e77-370b23e5dd24",
"a59efd3c-8a14-431d-84c8-daa085358c85",
"abf82f50-8974-4eee-90b1-a86ad5503a4b",
"c2c5f560-f262-407a-847b-a6729a4f8866",
"ce49556f-2d13-46c8-8f43-0ff65c56c8f2",
"d6cbb2d8-a2e9-4a6a-a369-0e85be2fa67f",
"eec3dbd5-0a24-425b-92c0-85db2d735947",
"f2a73997-992d-4f2d-88eb-7532dc4b7f0e",
"62a4d09b-c442-4aea-b100-d3e8447be5df",
"069d2b67-b748-4501-9b0f-02e70cc1b599",
"8e699fe6-48ba-41d5-bc68-f56496f7b2cf"
],
"folders_order": [],
"folders": [],
"requests": [
{
"id": "069d2b67-b748-4501-9b0f-02e70cc1b599",
"name": "Sideload - Replace",
"url": "http:\/\/{{Roku IP}}\/plugin_install",
"description": "",
"data": [
{
"key": "archive",
"value": "main.zip",
"description": "",
"type": "file",
"enabled": true
},
{
"key": "mysubmit",
"value": "Replace",
"description": "",
"type": "text",
"enabled": true
}
],
"dataOptions": null,
"dataMode": "params",
"headerData": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application\/x-www-form-urlencoded",
"description": "",
"type": "text"
}
],
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": {
"type": "digest",
"digest": [
{
"key": "username",
"value": "{{username}}"
},
{
"key": "password",
"value": "{{password}}"
},
{
"key": "opaque",
"value": "27d431aeb5855eae6a2ba8dcd1192a5e"
},
{
"key": "clientNonce",
"value": "17d467e22f08469c"
},
{
"key": "nonceCount",
"value": "0000002f"
},
{
"key": "nonce",
"value": "1576852008"
},
{
"key": "disableRetryRequest",
"value": true
},
{
"key": "qop",
"value": "auth"
},
{
"key": "realm",
"value": "rokudev"
},
{
"key": "algorithm",
"value": "MD5"
}
]
},
"events": null,
"folder": null,
"currentHelper": "digestAuth",
"helperAttributes": {
"id": "digest",
"algorithm": "MD5",
"username": "{{username}}",
"realm": "rokudev",
"password": "{{password}}",
"nonce": "1576852008",
"nonceCount": "0000002f",
"clientNonce": "17d467e22f08469c",
"opaque": "27d431aeb5855eae6a2ba8dcd1192a5e",
"qop": "auth",
"disableRetryRequest": true
},
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"headers": "Content-Type: application\/x-www-form-urlencoded\n",
"pathVariables": []
},
{
"id": "250f1ee7-ffd8-4e79-ba0f-38a9f973ea79",
"name": "Get All Sessions",
"url": "{{base}}\/sessions",
"description": "",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": [],
"method": "GET",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": [
{
"listen": "test",
"script": {
"id": "66e5ade3-65ea-4e3d-9425-5a7cc9cbae1b",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"const rokuIP = pm.environment.get(\"Roku IP\");",
"for (var i = 0; i < jsonData.length; i++) {",
" if (jsonData[i].value.ip === rokuIP) {",
" pm.setEnvironmentVariable(\"sessionId\", jsonData[i].sessionId);",
" break;",
" }",
"}",
""
],
"type": "text\/javascript"
}
}
],
"folder": null,
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"preRequestScript": null,
"tests": "var jsonData = JSON.parse(responseBody);\nconst rokuIP = pm.environment.get(\"Roku IP\");\nfor (var i = 0; i < jsonData.length; i++) {\n if (jsonData[i].value.ip === rokuIP) {\n pm.setEnvironmentVariable(\"sessionId\", jsonData[i].sessionId);\n break;\n }\n}\n",
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "",
"headers": "",
"pathVariables": []
},
{
"id": "2df25084-b163-435c-af34-c624fc99bf26",
"name": "Delete Session",
"url": "{{base}}\/session\/{{sessionId}}",
"description": "",
"data": null,
"dataMode": null,
"headerData": [],
"method": "DELETE",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": [],
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"headers": "",
"pathVariables": []
},
{
"id": "339e8a7a-6509-47b8-af53-2ce13e006872",
"name": "Press Button Sequence ",
"url": "{{base}}\/session\/{{sessionId}}\/press",
"description": "- Sends a sequence of button commands, as an array\n- Defaulted current to [\"up\", \"up\", \"up\"]\n- Available options include:\n - \"up\"\n - \"down\"\n - \"right\"\n - \"left\"\n - \"back\"\n - \"select\"\n - \"replay\"\n - \"play\"\n - \"stop\"\n - \"rewind\"\n - \"fast forward\"\n - \"options\"\n - \"home\"\n- Can also send any keyboard character by entering \"LIT_\" followed by the character.",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{\"button_sequence\": [\"up\", \"up\", \"select\"]}",
"pathVariables": []
},
{
"id": "4249ad17-63f1-4309-9496-1355d0ef9f41",
"name": "Create New Session",
"url": "{{base}}\/session",
"description": "",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": [],
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": [
{
"listen": "test",
"script": {
"id": "4df0421e-5caf-4125-ab00-82185de0adef",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"sessionId\", jsonData.sessionId);"
],
"type": "text\/javascript"
}
}
],
"folder": null,
"preRequestScript": null,
"tests": "var jsonData = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"sessionId\", jsonData.sessionId);",
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{ \"ip\": \"{{Roku IP}}\", \"timeout\": 0, \"pressDelay\": 0}",
"headers": "",
"pathVariables": []
},
{
"id": "450aae98-9f51-4552-b8ea-e66412a1838e",
"name": "Get Apps",
"url": "{{base}}\/session\/{{sessionId}}\/apps",
"description": "",
"data": null,
"dataMode": null,
"headerData": null,
"method": "GET",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"pathVariables": []
},
{
"id": "54097497-e25c-4bf0-b40c-64f5f937e28b",
"name": "Get Device Info",
"url": "{{base}}\/session\/{{sessionId}}",
"description": "",
"data": [],
"dataMode": "raw",
"headerData": [],
"method": "GET",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": [],
"folder": null,
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "",
"headers": "",
"pathVariables": []
},
{
"id": "62a4d09b-c442-4aea-b100-d3e8447be5df",
"name": "Sideload - Install",
"url": "http:\/\/{{Roku IP}}\/plugin_install",
"description": "",
"data": [
{
"key": "archive",
"value": "main.zip",
"description": "",
"type": "file",
"enabled": true
},
{
"key": "mysubmit",
"value": "Install",
"description": "",
"type": "text",
"enabled": true
}
],
"dataOptions": null,
"dataMode": "params",
"headerData": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application\/x-www-form-urlencoded",
"description": "",
"type": "text"
}
],
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": {
"type": "digest",
"digest": [
{
"key": "password",
"value": "{{password}}"
},
{
"key": "username",
"value": "{{username}}"
},
{
"key": "opaque",
"value": "27d431aeb5855eae6a2ba8dcd1192a5e"
},
{
"key": "clientNonce",
"value": "17d467e22f08469c"
},
{
"key": "nonceCount",
"value": "0000002f"
},
{
"key": "nonce",
"value": "1576852008"
},
{
"key": "disableRetryRequest",
"value": true
},
{
"key": "qop",
"value": "auth"
},
{
"key": "realm",
"value": "rokudev"
},
{
"key": "algorithm",
"value": "MD5"
}
]
},
"events": null,
"folder": null,
"currentHelper": "digestAuth",
"helperAttributes": {
"id": "digest",
"algorithm": "MD5",
"username": "{{username}}",
"realm": "rokudev",
"password": "{{password}}",
"nonce": "1576852008",
"nonceCount": "0000002f",
"clientNonce": "17d467e22f08469c",
"opaque": "27d431aeb5855eae6a2ba8dcd1192a5e",
"qop": "auth",
"disableRetryRequest": true
},
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"headers": "Content-Type: application\/x-www-form-urlencoded\n",
"pathVariables": []
},
{
"id": "62ac607d-f018-419a-9707-813174dcff6e",
"name": "Get Active Element",
"url": "{{base}}\/session\/{{sessionId}}\/element\/active",
"description": "",
"data": [],
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "",
"pathVariables": []
},
{
"id": "641ebb18-9e70-4341-bc49-ef708eecb309",
"name": "Install Channel",
"url": "{{base}}\/session\/{{sessionId}}\/install",
"description": "- Installs a channel.\n- Only works with non-\"dev\" channels.\n- {{installChannel}} variable is set to \"12\", which is Netflix.\n",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{\"channelId\": {{installChannel}}}",
"pathVariables": []
},
{
"id": "7699065d-36ba-4cff-a703-3e12143e5388",
"name": "Press Button",
"url": "{{base}}\/session\/{{sessionId}}\/press",
"description": "- Sends a single button command\n- Defaulted current to \"select\"\n- Available options include:\n - \"up\"\n - \"down\"\n - \"right\"\n - \"left\"\n - \"back\"\n - \"select\"\n - \"replay\"\n - \"play\"\n - \"stop\"\n - \"rewind\"\n - \"fast forward\"\n - \"options\"\n - \"home\"\n- Can also send any keyboard character by entering \"LIT_\" followed by the character.",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": [
{
"listen": "test",
"script": {
"id": "682c91a0-09b0-4452-b108-6c9d88da1f46",
"exec": [
""
],
"type": "text\/javascript"
}
}
],
"folder": null,
"preRequestScript": null,
"tests": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{\"button\": {{key}} }",
"pathVariables": []
},
{
"id": "8e699fe6-48ba-41d5-bc68-f56496f7b2cf",
"name": "Sideload - Delete",
"url": "http:\/\/{{Roku IP}}\/plugin_install",
"description": "",
"data": [
{
"key": "mysubmit",
"value": "Delete",
"description": "",
"type": "text",
"enabled": true
},
{
"key": "archive",
"value": "",
"description": "",
"type": "text",
"enabled": true
}
],
"dataOptions": null,
"dataMode": "params",
"headerData": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application\/x-www-form-urlencoded",
"description": "",
"type": "text"
}
],
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": {
"type": "digest",
"digest": [
{
"key": "password",
"value": "{{password}}"
},
{
"key": "nonce",
"value": "1576852008"
},
{
"key": "nonceCount",
"value": "00000046"
},
{
"key": "clientNonce",
"value": "d3544c2af87b7af3"
},
{
"key": "opaque",
"value": "8de98612f4255c38c164b3ee3024723b"
},
{
"key": "username",
"value": "{{username}}"
},
{
"key": "disableRetryRequest",
"value": true
},
{
"key": "qop",
"value": "auth"
},
{
"key": "realm",
"value": "rokudev"
},
{
"key": "algorithm",
"value": "MD5"
}
]
},
"events": null,
"folder": null,
"currentHelper": "digestAuth",
"helperAttributes": {
"id": "digest",
"algorithm": "MD5",
"username": "{{username}}",
"realm": "rokudev",
"password": "{{password}}",
"nonce": "1576852008",
"nonceCount": "00000046",
"clientNonce": "d3544c2af87b7af3",
"opaque": "8de98612f4255c38c164b3ee3024723b",
"qop": "auth",
"disableRetryRequest": true
},
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"headers": "Content-Type: application\/x-www-form-urlencoded\n",
"pathVariables": []
},
{
"id": "965382de-ba51-4cde-9e77-370b23e5dd24",
"name": "Get Current App",
"url": "{{base}}\/session\/{{sessionId}}\/current_app",
"description": "",
"data": null,
"dataMode": null,
"headerData": null,
"method": "GET",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"pathVariables": []
},
{
"id": "a59efd3c-8a14-431d-84c8-daa085358c85",
"name": "Set Implicit Timeout - 2000ms",
"url": "{{base}}\/session\/{{sessionId}}\/timeouts",
"description": "",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{\"type\": \"implicit\", \"ms\": 2000 }",
"pathVariables": []
},
{
"id": "abf82f50-8974-4eee-90b1-a86ad5503a4b",
"name": "Get UI Elements",
"url": "{{base}}\/session\/{{sessionId}}\/elements",
"description": "- Returns all elements that match the search criteria\n- \"elementData\" array can take the following objects:\n\t- \"using\", which can be \"text\", \"attr\", or \"tag\"\n\t- \"attribute\", only used if \"using\": \"attr\"\n\t- \"value\"",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{ \"elementData\": [{\"using\": \"attr\", \"attribute\": \"index\", \"value\": \"0\"}] }",
"pathVariables": []
},
{
"id": "c2c5f560-f262-407a-847b-a6729a4f8866",
"name": "Get Player Info",
"url": "{{base}}\/session\/{{sessionId}}\/player",
"description": "",
"data": null,
"dataMode": null,
"headerData": [],
"method": "GET",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": [],
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"headers": "",
"pathVariables": []
},
{
"id": "ce49556f-2d13-46c8-8f43-0ff65c56c8f2",
"name": "Get Screen Source",
"url": "{{base}}\/session\/{{sessionId}}\/source",
"description": "",
"data": null,
"dataMode": null,
"headerData": null,
"method": "GET",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"pathVariables": []
},
{
"id": "d6cbb2d8-a2e9-4a6a-a369-0e85be2fa67f",
"name": "Launch Channel",
"url": "{{base}}\/session\/{{sessionId}}\/launch",
"description": "Launches the channel.\nchannelCode can be updated as an environment variable if a channel other than \"dev\" needs to be launched.",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{\"channelId\": {{channelCode}}}",
"pathVariables": []
},
{
"id": "eec3dbd5-0a24-425b-92c0-85db2d735947",
"name": "Get UI Element",
"url": "{{base}}\/session\/{{sessionId}}\/element",
"description": "- Returns the first element that matches the search criteria\n- \"elementData\" array can take the following objects:\n\t- \"using\", which can be \"text\", \"attr\", or \"tag\"\n\t- \"attribute\", only used if \"using\": \"attr\"\n\t- \"value\"",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{ \"elementData\": [{\"using\": \"text\", \"value\": \"Item 1\"}]}",
"pathVariables": []
},
{
"id": "f2a73997-992d-4f2d-88eb-7532dc4b7f0e",
"name": "Set PressDelay Timeout - 1000ms",
"url": "{{base}}\/session\/{{sessionId}}\/timeouts",
"description": "",
"data": [],
"dataOptions": null,
"dataMode": "raw",
"headerData": null,
"method": "POST",
"pathVariableData": [],
"queryParams": [],
"auth": null,
"events": null,
"folder": null,
"currentHelper": null,
"helperAttributes": null,
"collectionId": "e118c10d-a5c0-46bb-8d14-8d74f1cd7d26",
"rawModeData": "{ \"type\": \"pressDelay\", \"ms\": 1000 }",
"pathVariables": []
}
]
}
{
"id": "484e36b5-3634-47e3-9469-a1b990b1b7f9",
"name": "Roku",
"values": [
{
"key": "Roku IP",
"value": "0.0.0.0",
"enabled": true
},
{
"key": "sessionId",
"value": "",
"enabled": true
},
{
"key": "channelCode",
"value": "\"dev\"",
"enabled": true
},
{
"key": "key",
"value": "\"up\"",
"enabled": true
},
{
"key": "key_sequence",
"value": "[\"up\", \"up\", \"down\"]",
"enabled": true
},
{
"key": "base",
"value": "http://localhost:9000/v1",
"enabled": true
},
{
"key": "installChannel",
"value": "\"12\"",
"enabled": true
},
{
"key": "username",
"value": "rokudev",
"enabled": true
},
{
"key": "password",
"value": "Pass123",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2019-12-20T19:16:18.588Z",
"_postman_exported_using": "Postman/7.14.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment