Get SMS messages

GET /sms/messages

Query parameters

  • from array[string]

    Filter based on the from msisdn

  • ref string

    Filter based on the ref of the message; can be null to filter on messages without a reference

  • paused boolean

    Filter based on whether the message is paused or not

  • completed boolean

    Filter based on whether the message has finished/completed

  • Return messages whose messageID is greater than or equal to this value

  • Return messages whose messageID is less than or equal to this value

  • created_at.min string(date-time)

    Return message created on or after this time; default is 24 hours ago

  • created_at.max string(date-time)

    Return message created on or before this time

  • limit integer

    Max number of messages to return (default 100, max 500)

  • offset integer

    Number of messages to skip (for pagination use)

  • sort string | array[string]

    Csv or array of sort field definitions, default is "-messageID" which means descending order of messageID, ie newest messages first

Responses

  • 200 application/json

    Successful operation

    Hide response attributes Show response attributes object
    • data array[object]
      Hide data attributes Show data attributes object
      • to array[string]

        List of msisdns to whom the message is being sent

      • messageID integer

        The Id of the message

      • from string

        The msisdn of the sender; this is who the recipient will see as the sender of the message

      • body string

        Message contents to send

      • send_at string(date-time)

        When to send the message; default is to send now

      • expires_at string(date-time)

        When the message should expire; any recipients not yet attempted will be abandoned

      • ref string

        Client reference; this will be included in any callbacks

      • callbackURL string(uri)

        URL that delivery reports should be sent to for this message

      • paused boolean

        Whether to submit the message in a paused state (will not be sent until released)

        Default value is false.

    • Are there more results which have not been included

  • Invalid input

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
  • Invalid input

GET /sms/messages
curl \
 -X GET https://sms.apicontrol.co.uk/v1/sms/messages \
 -H "Authorization: $API_KEY"
Response examples (200)
{
  "data": [
    {
      "to": [
        "+447700900111",
        "+447700900122"
      ],
      "messageID": 923934,
      "from": "+447700900001",
      "body": "Message to send",
      "send_at": "2024-06-03T10:05:22Z",
      "expires_at": "2024-06-04T10:05:22Z",
      "ref": "d93b9ec9-4e0d-42b8-80c0-ef3036acdafc",
      "callbackURL": "https://sms-callbacks.barbuck.com",
      "paused": false
    }
  ],
  "more_results": false
}
Response examples (401)
{
  "status_code": 401,
  "status_msg": "Unauthorized"
}