{"_id":"55674c2d7acd550d0075eb1d","category":{"_id":"55674b187acd550d0075eb14","pages":["55674b197acd550d0075eb16","55674c1d77c15523002fd5a3","55674c2d7acd550d0075eb1d","55674c9a77c15523002fd5a9","55674ce31c38390d006980c7","55674d1d7acd550d0075eb22","55674d7a77c15523002fd5b4","55674dac77c15523002fd5b6","55674e4c77c15523002fd5bb"],"__v":9,"project":"55674b177acd550d0075eb10","version":"55674b187acd550d0075eb13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-28T17:06:32.570Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"user":"5564f227f0f70f0d00a9ab20","__v":10,"project":"55674b177acd550d0075eb10","version":{"_id":"55674b187acd550d0075eb13","__v":1,"project":"55674b177acd550d0075eb10","createdAt":"2015-05-28T17:06:32.083Z","releaseDate":"2015-05-28T17:06:32.083Z","categories":["55674b187acd550d0075eb14"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-28T17:11:09.286Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[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\": \"coap get -H \\\"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\\\" coap://meshblu-coap.octoblu.com/devices?type=drone\",\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\": \"coap get -H \\\"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\\\" coap://meshblu-coap.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"_id\\\":\\\"5241d9140345450000000001\\\",\\\"api\\\":\\\"update\\\",\\\"armed\\\":true,\\\"channel\\\":\\\"main\\\",\\\"deviceDescription\\\":\\\"this is a test\\\",\\\"deviceName\\\":\\\"hackboard\\\",\\\"key\\\":\\\"777\\\",\\\"online\\\":true,\\\"socketid\\\":\\\"fO8dxKEwARUH9Ea- -p2C\\\",\\\"timestamp\\\":1381536277933,\\\"uuid\\\":\\\"ad698900-2546-11e3-87fb-c560cb0ca47b\\\"}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[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 and even override Meshblu's auto-generated UUID and/or token by passing your own uuid and/or token in the payload i.e. uuid=123&token=456\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"coap post -p \\\"type=drone&color=black\\\" -H \\\"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\\\" coap://meshblu-coap.octoblu.com/devices\",\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=black)\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"type\\\":\\\"drone\\\",\\\"color\\\":\\\"black\\\",\\\"uuid\\\":\\\"6f72bc60-32d5-11e3-92e2-e94f95fc16a6\\\",\\\"timestamp\\\":1381537803046,\\\"token\\\":\\\"4bbd2jm242dl5wmimbwz4rvlu77m0a4i\\\",\\\"channel\\\":\\\"main\\\",\\\"online\\\":false,\\\"_id\\\":\\\"5258980b56330f7dd000000d\\\"}\",\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. You must pass the token for security but you can pass any key/value pairs to update object as well as null to remove a propery (i.e. color=null). \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"coap put -p \\\"token=123&color=blue&online=true\\\" -H \\\"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\\\" coap://meshblu-coap.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Payload: token=123&key=value (i.e. token=123&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. You must pass the token for security. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"coap delete -p \\\"token=123\\\" -H \\\"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\\\" coap://meshblu-coap.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Payload: token=123\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"uuid\\\":\\\"ad698900-2546-11e3-87fb-c560cb0ca47b\\\",\\\"timestamp\\\":1381537971074}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"devices","type":"basic","title":"Devices"}
[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": "coap get -H \"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\" coap://meshblu-coap.octoblu.com/devices?type=drone", "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": "coap get -H \"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\" coap://meshblu-coap.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\"_id\":\"5241d9140345450000000001\",\"api\":\"update\",\"armed\":true,\"channel\":\"main\",\"deviceDescription\":\"this is a test\",\"deviceName\":\"hackboard\",\"key\":\"777\",\"online\":true,\"socketid\":\"fO8dxKEwARUH9Ea- -p2C\",\"timestamp\":1381536277933,\"uuid\":\"ad698900-2546-11e3-87fb-c560cb0ca47b\"}", "language": "json" } ] } [/block] [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 and even override Meshblu's auto-generated UUID and/or token by passing your own uuid and/or token in the payload i.e. uuid=123&token=456 [block:code] { "codes": [ { "code": "coap post -p \"type=drone&color=black\" -H \"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\" coap://meshblu-coap.octoblu.com/devices", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Payload: key=value (i.e. type=drone&color=black)" } [/block] [block:code] { "codes": [ { "code": "{\"type\":\"drone\",\"color\":\"black\",\"uuid\":\"6f72bc60-32d5-11e3-92e2-e94f95fc16a6\",\"timestamp\":1381537803046,\"token\":\"4bbd2jm242dl5wmimbwz4rvlu77m0a4i\",\"channel\":\"main\",\"online\":false,\"_id\":\"5258980b56330f7dd000000d\"}", "language": "json" } ] } [/block] [block:api-header] { "type": "put", "title": "/devices/{uuid}" } [/block] Updates a node or device currently registered with Meshblu. You must pass the token for security but you can pass any key/value pairs to update object as well as null to remove a propery (i.e. color=null). [block:code] { "codes": [ { "code": "coap put -p \"token=123&color=blue&online=true\" -H \"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\" coap://meshblu-coap.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Payload: token=123&key=value (i.e. token=123&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. You must pass the token for security. [block:code] { "codes": [ { "code": "coap delete -p \"token=123\" -H \"meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}\" coap://meshblu-coap.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Payload: token=123" } [/block] [block:code] { "codes": [ { "code": "{\"uuid\":\"ad698900-2546-11e3-87fb-c560cb0ca47b\",\"timestamp\":1381537971074}", "language": "json" } ] } [/block]