/devices
Registers a node or device with Meshblu. Meshblu returns a UUID device id and security token. You can pass any key/value pairs.
curl -X POST -d "type=drone&color=black" https://meshblu.octoblu.com/devices
Token
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.
Payload: key=value (i.e. type=drone&color=black)
{"type":"drone","color":"black","timestamp":1381537803046,"channel":"main","online":false,"_id":"5258980b56330f7dd000000d"}
Be sure to make note of your uuid and token as other calls require you to use these as a security check
/devices?key=value&key=value
Returns an array of device UUIDs based on key/value query criteria
curl -X GET https://meshblu.octoblu.com/devices?type=drone --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
{"devices":["ad698900-2546-11e3-87fb-c560cb0ca47b","2f3113d0-2796-11e3-95ef-e3081976e170"]}
/devices/{uuid}
Returns all information (except the token) of a specific device or node
curl -X GET \
--header "meshblu_auth_uuid: aed4cc6b-878d-4800-be50-bd7f0f11d026" \
--header "meshblu_auth_token: b072490f3eb5d782c7c3fb832d2a0421fbb8c40b" \
https://meshblu.octoblu.com/devices/aed4cc6b-878d-4800-be50-bd7f0f11d026
{
"devices": [
{
"configureWhitelist": [],
"discoverWhitelist": [],
"geo": {
"range": [
1138311168,
1138318591
],
"country": "US",
"region": "CA",
"city": "Goleta",
"ll": [
34.5021,
-120.1287
],
"metro": 855
},
"ipAddress": "67.217.90.1",
"online": false,
"receiveWhitelist": [],
"sendWhitelist": [],
"timestamp": "2015-06-23T01:39:26.526Z",
"uuid": "41a91d5d-477f-46b3-a4bb-9ce8ea478e38"
}
]
}
/devices/{uuid}/publickey
Returns the base64-encoded public key for the device, or null if the device does not have a public key.
curl -X GET https://meshblu.octoblu.com/devices/ad698900-2546-11e3-87fb-c560cb0ca47b/publickey
{"publicKey" : "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0NCk1JR2ZNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0R05BRENCaVFLQmdRQ3FHS3VrTzFEZTd6aFpqNitIMHF0alRrVnh3VENwdktlNGVDWjANCkZQcXJpMGNiMkpaZlhKL0RnWVNGNnZVcHdtSkc4d1ZRWktqZUdjakRPTDVVbHN1dXNGbmNDeldCUTdSS05VU2VzbVFSTVNHa1ZiMS8NCjNqK3NrWjZVdFcrNXUwOWxITnNqNnRRNTFzMVNQckNCa2VkYk5mMFRwMEdiTUpEeVI0ZTlUMDRaWndJREFRQUINCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ=="}
/devices/{uuid}/token
Reset the token for the device
curl -X POST \
--header "meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106" \
--header "meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9" \
https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/token
Reset Token
This will invalidate your previous token and your device will become inaccessible without the new token.
{
"uuid":"c9eeca22-fc0f-4081-b430-bd5b67091106",
"token":"167728cb25a449b39809ca2d82318703002d3628"
}
/devices/{uuid}/tokens
Returns a new session token for the device
curl -X POST \
--header "meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106" \
--header "meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9" \
https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens
{
"uuid":"c9eeca22-fc0f-4081-b430-bd5b67091106",
"token":"167728cb25a449b39809ca2d82318703002d3628"
}
/devices/{uuid}
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.
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}"
Payload: key=value (i.e. type=drone&color=blue&online=true)
{"uuid":"ad698900-2546-11e3-87fb-c560cb0ca47b","color":"blue","timestamp":1381537750462}
/devices/{uuid}
Deletes or unregisters a node or device currently registered with Meshblu that you have access to update.
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}"
{"uuid":"ad698900-2546-11e3-87fb-c560cb0ca47b"}