Get Latest Data

Get the most recent data sent by a device or application:

GET /get/latest/dweet/for/{thing}

Retrieve the most recent message sent by a device or application.

Contents

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

Uses and Requirements


Each dweet is stored on ThingSpace.io for 24 hours, up to a maximum of 500 dweets. If a thing sends more than 500 dweets in 24 hours, the oldest dweets are deleted to make room for the newer ones.

Request Components

HTTP Request

GET https://thingspace.io/get/latest/dweet/for/{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 sent the dweet in the resource path.

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

Header Parameters

None.

Request Body

None.

Example Request

GET https://thingspace.io/get/latest/dweet/for/my-thing-name

Success Responses


Status 200

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

  "this": "succeeded",
  "by": "getting",
  "the": "dweets",

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

### Example Success Response ###

{  
   "this":"succeeded",
   "by":"getting",
   "the":"dweets",
   "with":[  
      {  
         "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 Out!