Retrieve the most recent messages sent by a device or application in the last 24 hours, up to 500 messages. The most recent message is returned first.
See also:
Get the Latest Data from a Thing
Get Streamed Data from a Thing
Each message is stored on ThingSpace.io for 24 hours, up to a maximum of 500 messages. If a thing sends more than 500 messages in 24 hours, the oldest messages are deleted to make room for the newer ones.
GET https://thingspace.io/get/dweets/for/{thing}
You must specify the unique name of the thing (device or application) that sent the messages in the resource path.
Parameter Name | Data Type | Description |
---|---|---|
thing required |
string | The unique name of the device or application that sent the messages. |
None.
None.
GET https://thingspace.io/get/dweets/for/my-thing-name
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 an array of messages. Each message contains the thing name and a timestamp, followed by the contents of the message.
{
"this":"succeeded",
"by":"getting",
"the":"dweets",
"with":[
{
"thing":"my-thing-name",
"created":"2016-10-07T17:59:24.720Z",
"content":{
"status":"green",
"temp":48
}
},
{
"thing":"my-thing-name",
"created":"2016-10-07T18:08:12.120Z",
"content":{
"status":"yellow",
"temp":51
}
},
{
"thing":"my-thing-name",
"created":"2016-10-07T18:19:01.220Z",
"content":{
"status":"green",
"temp":49
}
}
]
}
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.