{"_id":"564f5cdaea8cef1900ae505e","user":"55dcd49b0efd5821000d5358","editedParams2":true,"project":"55dcd6a68a3dcd2300cc5f76","version":{"_id":"55dcd6a78a3dcd2300cc5f79","project":"55dcd6a68a3dcd2300cc5f76","__v":3,"createdAt":"2015-08-25T20:57:11.187Z","releaseDate":"2015-08-25T20:57:11.187Z","categories":["55dcd6a78a3dcd2300cc5f7a","55dce1048a3dcd2300cc5f96","55e49e35830ec32300e1a391"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"22.0.0","version":"22"},"__v":8,"editedParams":true,"category":{"_id":"55e49e35830ec32300e1a391","pages":["55e49f04de0d360d0027bc68","55e5f0bc9416190d00dc3a47","5609d60f9f85a70d00908572","5609d65c96ff420d004c8771","564f5cdaea8cef1900ae505e","56720127c17bf90d00b95845","5676d160511d400d0070f2fc"],"project":"55dcd6a68a3dcd2300cc5f76","version":"55dcd6a78a3dcd2300cc5f79","__v":7,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-31T18:34:29.204Z","from_sync":false,"order":1,"slug":"web-api-calls","title":"Web API Calls"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-20T17:48:10.251Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl -s -S -X GET -H content-type:application/json -H apikey:WeavedDemoKey$2015 -H token:00000000000000000000000 https://api.weaved.com/v22/api/device/send","name":""},{"code":"import httplib2\nimport base64\nfrom json import dumps\n   \napiMethod=\"https://\"\napiServer=\"api.weaved.com\"\napiKey=\"WeavedDemoKey$2015\"\n# replace this with the actual UID of your device\nUID=00:00:00:00:00:00:00:00\n# the command will be interpreted by the UDP listener on the other end\n# it is not equivalent to typing reboot on the command line unless the\n# UDP listener does that explicitly\ncommand=\"reboot\"\n\nserverChannelURL = apiMethod + apiServer + \"/api/device/send\n\nserverChannelHeaders = {\n                'Content-Type': content_type_header,\n                'apikey': apiKey,\n  \t\t\t\t\t\t\t# you need to get token from a call to /user/login\n                'token': token,\n            }\n\nserverChannelBody = {\n                'deviceaddress': UID,\n  \t\t\t\t\t\t\t'command':base64.b64encode(command)\n            }\n\nresponse, content = http.request( serverChannelURL,\n                                          'POST',\n                                          headers=serverChannelHeaders,\n                                 \t\t\t\t\tbody=dumps(serverChannelBody)\n                                \t\t\t\t\t)\n","language":"python"}]},"method":"get","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"status\": \"true\",\n}","name":""}]},"settings":"","auth":"required","params":[{"_id":"564f638e33082f0d001bb713","ref":"","in":"query","required":false,"desc":"Weaved UID of target daemon","default":"","type":"string","name":"deviceaddress"},{"_id":"564f638e33082f0d001bb712","ref":"","in":"query","required":false,"desc":"Base 64 encoded command string","default":"","type":"string","name":"command"}],"url":"/device/send"},"isReference":false,"order":3,"body":"You will need to supply the token received from a valid login using the /user/login call.  This call sends a command to the attached service which can be caught using a UDP listener.","excerpt":"Send a server channel command to the daemon associated with this UID. This is independent from the tcp connection to a listener on the target device.  A UDP listener needs to be written to listen to the port and process the commands.","slug":"devicesend","type":"endpoint","title":"/device/send"}

get/device/send

Send a server channel command to the daemon associated with this UID. This is independent from the tcp connection to a listener on the target device. A UDP listener needs to be written to listen to the port and process the commands.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

deviceaddress:
string
Weaved UID of target daemon
command:
string
Base 64 encoded command string

Examples


Result Format


Documentation

You will need to supply the token received from a valid login using the /user/login call. This call sends a command to the attached service which can be caught using a UDP listener.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}