Messages

ListMessages

Fetch historical device messages.

Currently supported parameter combinations:

appId + deviceId

topic + deviceId

appId

deviceId

topic

Not supported:

appId + topic

appId + topic + deviceId

For more information, see our nRF Cloud documentation on device messages.

get/messages

Query parameters

inclusiveStartstring date-time

HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).

Example:2020-06-25T21:05:12.830Z
startstring date-time

HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).

Example:2020-06-25T21:05:12.830Z
exclusiveEndstring date-time

HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).

Example:2020-06-25T21:05:12.830Z
endstring date-time

HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).

Example:2020-06-25T21:05:12.830Z
appIdstring
Example:TEMP

Filter returned messages by appId. Primarily used by Asset Tracker, AppId is taken from the "appId" property of the message body and is intended to represent the type of data being sent. This can be used to categorize your messages for easy filtering when using the same topic.

deviceIdstring

This is the canonical device id used in the device certificate, and as the MQTT client id.

Example:nrf-1234567890123456789000

A device Id to fetch messages for. Can be specified with appId or topic.

topicstring

A string specifying an MQTT topic.

Example:d/7e8f29fa-cb04-4351-a7c4-3917649d2d36/d2c/bulk

Fetch messages for a single topic. Can be specified with deviceId.

pageLimitinteger

Maximum number of items you want returned in the response (<=100).

pageSort'asc' | 'desc'

Sorting order for the paginated results => desc (descending; default) or asc (ascending).

Example:desc
pageNextTokenstring

If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding.

Example:4bb1f9ab35bd

Response

Ok

totalinteger

Reflects the total results returned by the query, which may be less than the total number of items available. If the response contains a pageNextToken value, you can supply the pageNextToken in the next request to get more results. The maximum value of total is the page limit of the request, or ten pages if no page limit is provided.

pageNextTokenstring

Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

Example response

{
  "items": [
    {
      "tenantId": "a5592ec1-18ae-4d9d-bc44-1d9bd927bbe9",
      "topic": "d/7e8f29fa-cb04-4351-a7c4-3917649d2d36/d2c/bulk",
      "deviceId": "nrf-1234567890123456789000",
      "receivedAt": "2020-06-25T21:05:12.830Z"
    }
  ],
  "total": 10,
  "pageNextToken": "4bb1f9ab35bd"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.