Get Streamed Data

Get streamed data sent by a device or application:

GET /listen/for/dweets/from/{thing}

Create a real-time subscription to messages from a thing using a “chunked” HTTP response. ThingSpace.io forwards messages as soon as they are received from a device or application.

Contents

See also:
Get all data from a thing
Get Streamed Data from a Thing

Request Components


HTTP Request

GET https://thingspace.io/listen/for/dweets/from/{thing}
NOTE: We recommend HTTPS for security, but both HTTP and HTTPS are supported.

Resource Path and Query Parameters

You must specify the unique name of the thing (device or application) that is sending the dweets in the resource path.

Parameter Name Data Type Description
thing
required
string The unique name of the device or application that is sending dweets.
NOTE: There is no validity checking on thing names

Header Parameters

None.

Request Body

None.

Example Request Body

GET https://thingspace.io/listen/for/dweets/from/my-thing-name

Success Responses


This request does not produce a standard HTTP response. Each chunked response contains only the message contents; they do not have the standard preamble that you’ll see with Get All Data and Get Latest Data.

Example Chunked Response

 {"thing":"my-thing-name","created":"2016-10-07T18:19:01.220Z","content":{"status":"green","temp":49}}

Failure Responses


Status 200

Errors are returned as HTTP status 200 in this format:

{
  "this": "failed",
  "with": HTTP status code,
  "because": "reason"
}

Where reason is a string describing the reason for the failure. The second line with the HTTP status code is not included in all error messages.

Try It!


When you listen for dweets, ThingSpace.io sends dweets as HTTP chunked responses, which cannot be tested here. Try something like:

curl --raw https://dweet.io/listen/for/dweets/from/{thing}

Note that curl will timeout after 60 seconds on some platforms if it does not receive any data, so be prepared to send at least one dweet shortly after you start the curl command.