Get message history for a channel

GET /channels/{channel_id}/messages

Get message history for a channel

Query parameters

  • start string
  • limit integer

    Default value is 100.

  • end string

    Default value is now.

  • Values are forwards or backwards. Default value is backwards.

Responses

  • OK

    Hide headers attributes Show headers attributes
    • x-ably-serverid string Required

      The ID for the server communicated with.

    Hide response attributes Show response attributes array[object]
    • name string

      The event name, if provided.

    • data string

      The string encoded payload, with the encoding specified below.

    • id string

      A Unique ID that can be specified by the publisher for idempotent publishing.

    • timestamp integer(int64)

      Timestamp when the message was received by the Ably, as milliseconds since the epoch.

    • encoding string

      This will typically be empty as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the data payload.

    • clientId string

      The client ID of the publisher of this message.

    • The connection ID of the publisher of this message.

    • extras object

      Extras object. Currently only allows for push extra.

      Hide extras attribute Show extras attribute object
      • push object
        Hide push attributes Show push attributes object
        • data string
        • Hide notification attributes Show notification attributes object
          • title string

            Title to display at the notification.

          • body string

            Text below title on the expanded notification.

          • icon string

            Platform-specific icon for the notification.

          • sound string

            Platform-specific sound for the notification.

          • Platform-specific, used to group notifications together.

        • apns object

          Extends and overrides generic values when delivering via APNs. See examples

          Hide apns attribute Show apns attribute object
          • Hide notification attributes Show notification attributes object
            • title string

              Title to display at the notification.

            • body string

              Text below title on the expanded notification.

            • icon string

              Platform-specific icon for the notification.

            • sound string

              Platform-specific sound for the notification.

            • Platform-specific, used to group notifications together.

        • fcm object

          Extends and overrides generic values when delivering via GCM/FCM. See examples

          Hide fcm attribute Show fcm attribute object
          • Hide notification attributes Show notification attributes object
            • title string

              Title to display at the notification.

            • body string

              Text below title on the expanded notification.

            • icon string

              Platform-specific icon for the notification.

            • sound string

              Platform-specific sound for the notification.

            • Platform-specific, used to group notifications together.

        • web object

          Extends and overrides generic values when delivering via web. See examples

          Hide web attribute Show web attribute object
          • Hide notification attributes Show notification attributes object
            • title string

              Title to display at the notification.

            • body string

              Text below title on the expanded notification.

            • icon string

              Platform-specific icon for the notification.

            • sound string

              Platform-specific sound for the notification.

            • Platform-specific, used to group notifications together.

  • Error

    Hide headers attributes Show headers attributes
GET /channels/{channel_id}/messages
curl \
 -X GET https://rest.ably.io/channels/{channel_id}/messages
Response examples (201)
# Headers
link: string
x-ably-serverid: string

# Payload
[
  {
    "name": "string",
    "data": "string",
    "id": "string",
    "timestamp": 42,
    "encoding": "string",
    "clientId": "string",
    "connectionId": "string",
    "extras": {
      "push": {
        "data": "string",
        "notification": {
          "title": "string",
          "body": "string",
          "icon": "string",
          "sound": "string",
          "collapseKey": "string"
        },
        "apns": {
          "notification": {
            "title": "string",
            "body": "string",
            "icon": "string",
            "sound": "string",
            "collapseKey": "string"
          }
        },
        "fcm": {
          "notification": {
            "title": "string",
            "body": "string",
            "icon": "string",
            "sound": "string",
            "collapseKey": "string"
          }
        },
        "web": {
          "notification": {
            "title": "string",
            "body": "string",
            "icon": "string",
            "sound": "string",
            "collapseKey": "string"
          }
        }
      }
    }
  }
]
Response examples (201)
# Headers
link: string
x-ably-serverid: string

# Payload
[
  {
    "name": "string",
    "data": "string",
    "id": "string",
    "timestamp": 42,
    "encoding": "string",
    "clientId": "string",
    "connectionId": "string",
    "extras": {
      "push": {
        "data": "string",
        "notification": {
          "title": "string",
          "body": "string",
          "icon": "string",
          "sound": "string",
          "collapseKey": "string"
        },
        "apns": {
          "notification": {
            "title": "string",
            "body": "string",
            "icon": "string",
            "sound": "string",
            "collapseKey": "string"
          }
        },
        "fcm": {
          "notification": {
            "title": "string",
            "body": "string",
            "icon": "string",
            "sound": "string",
            "collapseKey": "string"
          }
        },
        "web": {
          "notification": {
            "title": "string",
            "body": "string",
            "icon": "string",
            "sound": "string",
            "collapseKey": "string"
          }
        }
      }
    }
  }
]