Meshblu HTTP Streaming Hostname change
Due to some limitations of streaming chunked data, and keeping long-lived idle connections, to the client, we have set up a dedicated host for streaming Meshblu messages over http.
https://meshblu-http-streaming.octoblu.com
We will permanently redirect all requests sent to
https://meshblu.octoblu.com/subscribe*
to the new host.
/subscribe
This is a streaming API that returns device/node messages as they are sent and received. Meshblu doesn't close the stream.
curl -L -X GET https://meshblu.octoblu.com/subscribe --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
{
"devices":"0d3a53a0-2a0b-11e3-b09c-ff4de847b2cc",
"payload":
{
"red":"on"
}
}
{
"devices":"0d3a53a0-2a0b-11e3-b09c-ff4de847b2cc",
"payload":
{
"red":"on"
}
}
Subscribe by type
You can limit the types of messages you subscribe to by using the types
parameter.
Valid types include:
broadcast
- broadcast messages sent by the devicereceived
- messages received by the devicesent
- messages sent by the device
Default is all types.
Specify multiple types
options in your url to subscribe to multiple types.
curl -L -X GET https://meshblu.octoblu.com/subscribe?types=sent&types=received --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
Filter by topic
You can limit the topics of the messages you are subscribed to by using the topics
parameter.
Topics support:
- string: e.g.
device-status
- wildcard: e.g.
*device*
You may also omit topics by prepending a -
on the topic you wish to skip. e.g. -device-status
Specify multiple topics
options in your url to filter (or omit) multiple topics.
curl -L -X GET https://meshblu.octoblu.com/subscribe?topics=device*&topics=-*-status* --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
/subscribe/{uuid}
This is a streaming API that returns device/node messages as they are sent and received. Meshblu doesn't close the stream. This will stream messages from the uuid you've specified.
Permissions
The uuid/token you're authenticating with must have permissions to view messages from the subscribed uuid, either as the owner or in the receiveWhitelist. You may also use the token as a query parameter.
curl -L -X GET https://meshblu.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
Subscribe with token
curl -L -X GET https://meshblu.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b?token=0a17660ff1a8d374f1a9ba17cb1b2aac4bbb25ea
--header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
{
"fromUUid":"ad698900-2546-11e3-87fb-c560cb0ca47b",
"devices":"*",
"payload":
{
"red":"on"
}
}
/subscribe/{uuid}/broadcast
Subscribe to only broadcast messages sent by the subscribed device.
curl -L -X GET https://meshblu.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b/broadcast --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
Response
{
"fromUUid":"ad698900-2546-11e3-87fb-c560cb0ca47b",
"devices":"*",
"payload":
{
"red":"on"
}
}
/subscribe/{uuid}/received
Subscribe to only messages received by the subscribed device.
curl -L -X GET https://meshblu.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b/received --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
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.
curl -L -X GET https://meshblu.octoblu.com/subscribe/ad698900-2546-11e3-87fb-c560cb0ca47b/sent --header "meshblu_auth_uuid: {my uuid}" --header "meshblu_auth_token: {my token}"
Response
{
"fromUUid": "ad698900-2546-11e3-87fb-c560cb0ca47b",
"devices": ["ddd98900-2546-11e3-87fb-c560cb0ca47b"],
"payload":
{
"red":"on"
}
}