Subscribe

/subscribe

This is a streaming API that returns device/node messages as they are sent and received. Notice the comma at the end of the response. Meshblu doesn't close the stream.

coap get -H "meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}" coap://meshblu-coap.octoblu.com/subscribe -o
{"devices":"0d3a53a0-2a0b-11e3-b09c-ff4de847b2cc","message":{"red":"on"},"timestamp":1388768270795,"eventCode":300,"_id":"52c6ec0e4f67671e44000001"},{"devices":"0d3a53a0-2a0b-11e3-b09c-ff4de847b2cc","message":{"red":"on"},"timestamp":1388768277473,"eventCode":300,"_id":"52c6ec154f67671e44000002"},

/subscribe/{uuid}

This is a streaming API that returns device/node broadcasts messages as they are sent. Notice the comma at the end of the response. Meshblu doesn't close the stream. This will stream broadcast messages from the uuid you've specified. The uuid/token you're authenticating with must have permissions to view messages from the subscribed uuid.

coap get -H "meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}" coap://meshblu-coap.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b -o
{"devices":"*","fromUuid":"ad698900-2546-11e3-87fb-c560cb0ca47b","message":{"red":"on"},"timestamp":1388768270795,"eventCode":300,"_id":"52c6ec0e4f67671e44000001"},{"devices":"*","fromUuid":"ad698900-2546-11e3-87fb-c560cb0ca47b","message":{"red":"on"},"timestamp":1388768277473,"eventCode":300,"_id":"52c6ec154f67671e44000002"},

/subscribe/{uuid}/broadcast

Subscribe to only broadcast messages sent by the subscribed device.

coap get -H "meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}" coap://meshblu-coap.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b/broadcast -o

Response

{
  "fromUUid":"ad698900-2546-11e3-87fb-c560cb0ca47b",
  "devices":"*",
  "payload":
  {
    "red":"on"
  }
}

/subscribe/{uuid}/received

Subscribe to only messages received by the subscribed device.

coap get -H "meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}" coap://meshblu-coap.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b/received -o

Response

{
  "fromUUid":"ad698900-2546-11e3-87fb-c560cb0ca47b",
  "devices":"ad698900-2546-11e3-87fb-c560cb0ca47b",
  "payload":
  {
    "red":"on"
  }
}

/subscribe/{uuid}/sent

Subscribe to messages sent by the subscribed device.

coap get -H "meshblu_auth_uuid={:UUID}&meshblu_auth_token={:TOKEN}" coap://meshblu-coap.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b/sent -o

Response

{
  "fromUUid": "ad698900-2546-11e3-87fb-c560cb0ca47b",
  "devices": ["ddd98900-2546-11e3-87fb-c560cb0ca47b"],
  "payload":
  {
    "red":"on"
  }
}