Send Data With GET

Send data from a thing or app using GET:

GET /dweet/for/{thing}

Use a GET request to send data from a device or application to ThingSpace.io, with the data as query parameters in the request.

  • The data will be stored for 24 hours (maximum of 500 messages per thing)
  • Your application can listen continuously for data from things, or it can retrieve the latest data.
  • Devices can listen continuously for messages from your application, or they can retrieve the latest messages.
  • Data can be displayed in a freeboard.

Contents

See also:
Send data from a thing or app using POST

Uses and Requirements


You must use POST to send nested values, or if you want to encrypt the data during transmission.

Each dweet from a device or application must contain all data that the device is capable of sending. For example, if a car is monitoring speed, engine RPM, and oil pressure, each dweet must contain all three measurements, instead of three separate dweets that each contain only one measurement.

Request Components


HTTP Request

GET https://thingspace.io/dweet/for/{thing}?{key}={value}
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 device or application that is sending the dweet in the resource path, followed by query parameters for the names and values of the data to be sent.

Parameter Name Data Type Description
thing
required
string The unique name of the device or application. Other devices, applications, and freeboards can use this name to get data sent by the device.
key
optional
string The name of the data element being sent.
value
optional
string The value of the data.
NOTE: There is no validity checking on thing names

Header Parameters

None.

Request Body

None.

Example Request

GET https://thingspace.io/dweet/for/my-thing-name?status=green&temp=48

Success Responses


Status 200
The response body is a JSON-formatted message. All success responses begin with this preamble:

{
"this": "succeeded",
  "by": "dweeting",
  "the": "dweet"
}

That is followed by the “with” object that contains the thing name and a timestamp for the dweet, followed by the contents that were recorded.

Example Success Response

{
  "this": "succeeded",
  "by": "dweeting",
  "the": "dweet",
  "with": {
    "thing": "my-thing-name",
    "created": "2016-10-07T17:59:24.720Z",
    "content": {
      "status": "green",
      "temp": 48
    }
   }
}

Failure Responses


Status 200 Errors are returned as HTTP status 200 in this format:

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

Try It!


You can use curl to try sending dweet messages with GET. Simply pick a unique name for your thing and then use this format:

curl https://thingspace.io/dweet/for/my-thing-name?status=green&temp=48