v1

latestOpenAPI 3.1.02026-07-2617501.1 MB

List all the messages for user (using a date range)

get/v2/messages/

Query parameters

sent_afterstring date

Specify the date after which the messages were sent by the user. NOTE: The date range must be between the start of the last week and end of current day (today) and in UTC.

sent_beforestring date

Specify a date range before which the messages were sent by the user. NOTE: The date range must be between the start of the last week and end of current day (today) and in UTC.

sender_idinteger required

Specify the ID of the user who sent the messages.

receiver_ids[]integer[]

Optionally, you can also narrow down the search results by adding the receiver's IDs.

per_pageinteger

The number of records to be displayed per page.

page_nointeger

The current page number.

Headers

X-Time-Zonestring

Specify the timezone for formatting the timestamps.

X-Metric-Unitsboolean

Specify if you want to use the Metric units or the Imperial units. TRUE: Metric units. FALSE: Imperial Units

Response

200

Example response

{
  "messages": [
    {
      "message": {
        "sent_at": "2021-05-10T21:02:31Z",
        "id": "layer:///messages/c0bb2a67-1bc4-4be6-9a8e-a986388be477",
        "sender_id": 1645,
        "receiver_ids": [
          1591
        ],
        "body": "Test1",
        "status": "read"
      }
    }
  ],
  "pagination": {
    "per_page": 25,
    "page_no": 1,
    "total": 2
  }
}