{"__v":4,"_id":"5566352a979a3c2500bbafa8","category":{"__v":16,"_id":"55650b9fb893840d00444702","pages":["55650b9fb893840d00444704","55662e121ec2311900e4c538","55663058f579050d00c3d42d","556633b61ec2311900e4c544","55663419f579050d00c3d43f","55663490979a3c2500bbafa6","5566352a979a3c2500bbafa8","55663578979a3c2500bbafab","556635fd1ec2311900e4c551","5566365a979a3c2500bbafb3","556636daf579050d00c3d448","5568d269c87afd2500e5254c","556b5b46ab693b1900ce1722","556bbee230922f1700ad5e22","5578af9327f77c0d00fe62ce","567328a458c4890d00bb545f"],"project":"55650b9eb893840d004446fe","version":"55650b9eb893840d00444701","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-27T00:11:11.144Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"parentDoc":null,"project":"55650b9eb893840d004446fe","user":"5564f227f0f70f0d00a9ab20","version":{"__v":2,"_id":"55650b9eb893840d00444701","project":"55650b9eb893840d004446fe","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-27T21:20:42.135Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Content-Type\",\n  \"body\": \"If you are posting JSON in the body, you must set Content-Type: application/json\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/messages\"\n}\n[/block]\nSend a message to a specific device, array of devices, or all devices subscribing to a UUID on the Meshblu platform \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -d '{\\\"devices\\\": \\\"*\\\", \\\"payload\\\": {\\\"yellow\\\":\\\"off\\\"}}' https://meshblu.octoblu.com/messages --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\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -d '{\\\"devices\\\": [\\\"ad6...47b\\\",\\\"2f3...170\\\"], \\\"payload\\\": {\\\"yellow\\\":\\\"off\\\"}}' https://meshblu.octoblu.com/messages --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\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -d '{\\\"devices\\\": \\\"ad698900-2546-11e3-87fb-c560cb0ca47b\\\", \\\"payload\\\": {\\\"yellow\\\":\\\"off\\\"}}' https://meshblu.octoblu.com/messages --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\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -d '{\\\"devices\\\": \\\"ad698900-2546-11e3-87fb-c560cb0ca47b/2f3113d0-2796-11e3-95ef-e3081976e170\\\", \\\"message\\\": {\\\"yellow\\\":\\\"off\\\"}}' \\\"https://localhost:3000/messages\\\" --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\\\":\\\"*\\\",\\\"payload\\\":{\\\"yellow\\\":\\\"off\\\"}}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"NOTE:\",\n  \"body\": \"If your Meshblu cloud is connected to meshblu.octoblu.com or other private Meshblu clouds, you can send messages across Meshblu clouds by chaining UUIDs together separated by slashes (/) where the first UUID is the target cloud and the second UUID is the device on that cloud.\"\n}\n[/block]","excerpt":"","slug":"messages","type":"basic","title":"Messages"}
[block:callout] { "type": "warning", "title": "Content-Type", "body": "If you are posting JSON in the body, you must set Content-Type: application/json" } [/block] [block:api-header] { "type": "post", "title": "/messages" } [/block] Send a message to a specific device, array of devices, or all devices subscribing to a UUID on the Meshblu platform [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -d '{\"devices\": \"*\", \"payload\": {\"yellow\":\"off\"}}' https://meshblu.octoblu.com/messages --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -d '{\"devices\": [\"ad6...47b\",\"2f3...170\"], \"payload\": {\"yellow\":\"off\"}}' https://meshblu.octoblu.com/messages --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -d '{\"devices\": \"ad698900-2546-11e3-87fb-c560cb0ca47b\", \"payload\": {\"yellow\":\"off\"}}' https://meshblu.octoblu.com/messages --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST -H \"Content-Type: application/json\" -d '{\"devices\": \"ad698900-2546-11e3-87fb-c560cb0ca47b/2f3113d0-2796-11e3-95ef-e3081976e170\", \"message\": {\"yellow\":\"off\"}}' \"https://localhost:3000/messages\" --header \"meshblu_auth_uuid: {my uuid}\" --header \"meshblu_auth_token: {my token}\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\"devices\":\"*\",\"payload\":{\"yellow\":\"off\"}}", "language": "json" } ] } [/block] [block:callout] { "type": "info", "title": "NOTE:", "body": "If your Meshblu cloud is connected to meshblu.octoblu.com or other private Meshblu clouds, you can send messages across Meshblu clouds by chaining UUIDs together separated by slashes (/) where the first UUID is the target cloud and the second UUID is the device on that cloud." } [/block]