{"_id":"55663058f579050d00c3d42d","category":{"_id":"55650b9fb893840d00444702","version":"55650b9eb893840d00444701","pages":["55650b9fb893840d00444704","55662e121ec2311900e4c538","55663058f579050d00c3d42d","556633b61ec2311900e4c544","55663419f579050d00c3d43f","55663490979a3c2500bbafa6","5566352a979a3c2500bbafa8","55663578979a3c2500bbafab","556635fd1ec2311900e4c551","5566365a979a3c2500bbafb3","556636daf579050d00c3d448","5568d269c87afd2500e5254c","556b5b46ab693b1900ce1722","556bbee230922f1700ad5e22","5578af9327f77c0d00fe62ce","567328a458c4890d00bb545f"],"project":"55650b9eb893840d004446fe","__v":16,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-27T00:11:11.144Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"version":{"_id":"55650b9eb893840d00444701","project":"55650b9eb893840d004446fe","__v":2,"createdAt":"2015-05-27T00:11:10.647Z","releaseDate":"2015-05-27T00:11:10.647Z","categories":["55650b9fb893840d00444702","5566a1557acd550d0075e894"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":19,"parentDoc":null,"project":"55650b9eb893840d004446fe","user":"5564f227f0f70f0d00a9ab20","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-27T21:00:08.653Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/devices\"\n}\n[/block]\nRegisters a node or device with Meshblu. Meshblu returns a UUID device id and security token. You can pass any key/value pairs.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -d \\\"type=drone&color=black\\\" https://meshblu.octoblu.com/devices\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Token\",\n  \"body\": \"Device registration is the only time your token will be given to you. Be sure to keep it somewhere safe as the token is required to update your device in the future.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Payload: key=value (i.e. type=drone&color=black)\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"type\\\":\\\"drone\\\",\\\"color\\\":\\\"black\\\",\\\"timestamp\\\":1381537803046,\\\"channel\\\":\\\"main\\\",\\\"online\\\":false,\\\"_id\\\":\\\"5258980b56330f7dd000000d\\\"}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Be sure to make note of your uuid and token as other calls require you to use these as a security check\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"/devices?key=value&key=value\"\n}\n[/block]\nReturns an array of device UUIDs based on key/value query criteria \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET https://meshblu.octoblu.com/devices?type=drone --header \\\"meshblu_auth_uuid: {my uuid}\\\" --header \\\"meshblu_auth_token: {my token}\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"devices\\\":[\\\"ad698900-2546-11e3-87fb-c560cb0ca47b\\\",\\\"2f3113d0-2796-11e3-95ef-e3081976e170\\\"]}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"/devices/{uuid}\"\n}\n[/block]\nReturns all information (except the token) of a specific device or node \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET \\\\\\n  --header \\\"meshblu_auth_uuid: aed4cc6b-878d-4800-be50-bd7f0f11d026\\\" \\\\\\n  --header \\\"meshblu_auth_token: b072490f3eb5d782c7c3fb832d2a0421fbb8c40b\\\" \\\\\\n  https://meshblu.octoblu.com/devices/aed4cc6b-878d-4800-be50-bd7f0f11d026\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"devices\\\": [\\n    {\\n      \\\"configureWhitelist\\\": [],\\n      \\\"discoverWhitelist\\\": [],\\n      \\\"geo\\\": {\\n        \\\"range\\\": [\\n          1138311168,\\n          1138318591\\n        ],\\n        \\\"country\\\": \\\"US\\\",\\n        \\\"region\\\": \\\"CA\\\",\\n        \\\"city\\\": \\\"Goleta\\\",\\n        \\\"ll\\\": [\\n          34.5021,\\n          -120.1287\\n        ],\\n        \\\"metro\\\": 855\\n      },\\n      \\\"ipAddress\\\": \\\"67.217.90.1\\\",\\n      \\\"online\\\": false,\\n      \\\"receiveWhitelist\\\": [],\\n      \\\"sendWhitelist\\\": [],\\n      \\\"timestamp\\\": \\\"2015-06-23T01:39:26.526Z\\\",\\n      \\\"uuid\\\": \\\"41a91d5d-477f-46b3-a4bb-9ce8ea478e38\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"/devices/{uuid}/publickey\"\n}\n[/block]\nReturns the base64-encoded public key for the device, or null if the device does not have a public key. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b/publickey\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"publicKey\\\" : \\\"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0NCk1JR2ZNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0R05BRENCaVFLQmdRQ3FHS3VrTzFEZTd6aFpqNitIMHF0alRrVnh3VENwdktlNGVDWjANCkZQcXJpMGNiMkpaZlhKL0RnWVNGNnZVcHdtSkc4d1ZRWktqZUdjakRPTDVVbHN1dXNGbmNDeldCUTdSS05VU2VzbVFSTVNHa1ZiMS8NCjNqK3NrWjZVdFcrNXUwOWxITnNqNnRRNTFzMVNQckNCa2VkYk5mMFRwMEdiTUpEeVI0ZTlUMDRaWndJREFRQUINCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==\\\"}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/devices/{uuid}/token\"\n}\n[/block]\nReset the token for the device\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST \\\\\\n  --header \\\"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\\\" \\\\\\n  --header \\\"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\\\" \\\\\\n  https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/token\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Reset Token\",\n  \"body\": \"This will invalidate your previous token and your device will become inaccessible without the new token.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"uuid\\\":\\\"c9eeca22-fc0f-4081-b430-bd5b67091106\\\",\\n  \\\"token\\\":\\\"167728cb25a449b39809ca2d82318703002d3628\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/devices/{uuid}/tokens\"\n}\n[/block]\nReturns a new session token for the device\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST \\\\\\n  --header \\\"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\\\" \\\\\\n  --header \\\"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\\\" \\\\\\n  https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"uuid\\\":\\\"c9eeca22-fc0f-4081-b430-bd5b67091106\\\",\\n  \\\"token\\\":\\\"167728cb25a449b39809ca2d82318703002d3628\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"put\",\n  \"title\": \"/devices/{uuid}\"\n}\n[/block]\nUpdates a node or device currently registered with Meshblu that you have access to update. You can pass any key/value pairs to update object.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X PUT -d \\\"color=blue&online=true\\\" https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b --header \\\"meshblu_auth_uuid: {my uuid}\\\" --header \\\"meshblu_auth_token: {my token}\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Payload: key=value (i.e. type=drone&color=blue&online=true)\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"uuid\\\":\\\"ad698900-2546-11e3-87fb-c560cb0ca47b\\\",\\\"color\\\":\\\"blue\\\",\\\"timestamp\\\":1381537750462}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"delete\",\n  \"title\": \"/devices/{uuid}\"\n}\n[/block]\nDeletes or unregisters a node or device currently registered with Meshblu that you have access to update. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X DELETE https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b --header \\\"meshblu_auth_uuid: {my uuid}\\\" --header \\\"meshblu_auth_token: {my token}\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"uuid\\\":\\\"ad698900-2546-11e3-87fb-c560cb0ca47b\\\"}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"devices","type":"basic","title":"Devices"}
[block:api-header] { "type": "post", "title": "/devices" } [/block] Registers a node or device with Meshblu. Meshblu returns a UUID device id and security token. You can pass any key/value pairs. [block:code] { "codes": [ { "code": "curl -X POST -d \"type=drone&color=black\" https://meshblu.octoblu.com/devices", "language": "shell" } ] } [/block] [block:callout] { "type": "danger", "title": "Token", "body": "Device registration is the only time your token will be given to you. Be sure to keep it somewhere safe as the token is required to update your device in the future." } [/block] [block:callout] { "type": "info", "title": "Payload: key=value (i.e. type=drone&color=black)" } [/block] [block:code] { "codes": [ { "code": "{\"type\":\"drone\",\"color\":\"black\",\"timestamp\":1381537803046,\"channel\":\"main\",\"online\":false,\"_id\":\"5258980b56330f7dd000000d\"}", "language": "json" } ] } [/block] [block:callout] { "type": "warning", "title": "Be sure to make note of your uuid and token as other calls require you to use these as a security check" } [/block] [block:api-header] { "type": "get", "title": "/devices?key=value&key=value" } [/block] Returns an array of device UUIDs based on key/value query criteria [block:code] { "codes": [ { "code": "curl -X GET https://meshblu.octoblu.com/devices?type=drone --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\"devices\":[\"ad698900-2546-11e3-87fb-c560cb0ca47b\",\"2f3113d0-2796-11e3-95ef-e3081976e170\"]}", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "/devices/{uuid}" } [/block] Returns all information (except the token) of a specific device or node [block:code] { "codes": [ { "code": "curl -X GET \\\n --header \"meshblu_auth_uuid: aed4cc6b-878d-4800-be50-bd7f0f11d026\" \\\n --header \"meshblu_auth_token: b072490f3eb5d782c7c3fb832d2a0421fbb8c40b\" \\\n https://meshblu.octoblu.com/devices/aed4cc6b-878d-4800-be50-bd7f0f11d026\n", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"devices\": [\n {\n \"configureWhitelist\": [],\n \"discoverWhitelist\": [],\n \"geo\": {\n \"range\": [\n 1138311168,\n 1138318591\n ],\n \"country\": \"US\",\n \"region\": \"CA\",\n \"city\": \"Goleta\",\n \"ll\": [\n 34.5021,\n -120.1287\n ],\n \"metro\": 855\n },\n \"ipAddress\": \"67.217.90.1\",\n \"online\": false,\n \"receiveWhitelist\": [],\n \"sendWhitelist\": [],\n \"timestamp\": \"2015-06-23T01:39:26.526Z\",\n \"uuid\": \"41a91d5d-477f-46b3-a4bb-9ce8ea478e38\"\n }\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "/devices/{uuid}/publickey" } [/block] Returns the base64-encoded public key for the device, or null if the device does not have a public key. [block:code] { "codes": [ { "code": "curl -X GET https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b/publickey", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\"publicKey\" : \"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0NCk1JR2ZNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0R05BRENCaVFLQmdRQ3FHS3VrTzFEZTd6aFpqNitIMHF0alRrVnh3VENwdktlNGVDWjANCkZQcXJpMGNiMkpaZlhKL0RnWVNGNnZVcHdtSkc4d1ZRWktqZUdjakRPTDVVbHN1dXNGbmNDeldCUTdSS05VU2VzbVFSTVNHa1ZiMS8NCjNqK3NrWjZVdFcrNXUwOWxITnNqNnRRNTFzMVNQckNCa2VkYk5mMFRwMEdiTUpEeVI0ZTlUMDRaWndJREFRQUINCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==\"}", "language": "json" } ] } [/block] [block:api-header] { "type": "post", "title": "/devices/{uuid}/token" } [/block] Reset the token for the device [block:code] { "codes": [ { "code": "curl -X POST \\\n --header \"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\" \\\n --header \"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\" \\\n https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/token", "language": "shell" } ] } [/block] [block:callout] { "type": "danger", "title": "Reset Token", "body": "This will invalidate your previous token and your device will become inaccessible without the new token." } [/block] [block:code] { "codes": [ { "code": "{\n \"uuid\":\"c9eeca22-fc0f-4081-b430-bd5b67091106\",\n \"token\":\"167728cb25a449b39809ca2d82318703002d3628\"\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "post", "title": "/devices/{uuid}/tokens" } [/block] Returns a new session token for the device [block:code] { "codes": [ { "code": "curl -X POST \\\n --header \"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\" \\\n --header \"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\" \\\n https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"uuid\":\"c9eeca22-fc0f-4081-b430-bd5b67091106\",\n \"token\":\"167728cb25a449b39809ca2d82318703002d3628\"\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "put", "title": "/devices/{uuid}" } [/block] Updates a node or device currently registered with Meshblu that you have access to update. You can pass any key/value pairs to update object. [block:code] { "codes": [ { "code": "curl -X PUT -d \"color=blue&online=true\" https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Payload: key=value (i.e. type=drone&color=blue&online=true)" } [/block] [block:code] { "codes": [ { "code": "{\"uuid\":\"ad698900-2546-11e3-87fb-c560cb0ca47b\",\"color\":\"blue\",\"timestamp\":1381537750462}", "language": "json" } ] } [/block] [block:api-header] { "type": "delete", "title": "/devices/{uuid}" } [/block] Deletes or unregisters a node or device currently registered with Meshblu that you have access to update. [block:code] { "codes": [ { "code": "curl -X DELETE https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\"uuid\":\"ad698900-2546-11e3-87fb-c560cb0ca47b\"}", "language": "json" } ] } [/block]