Developer Docs

Table of contents

Get SMS messages

The method allows you to get information about the status of a single message or the status of each message in an SMS campaign.

Request URL

GET  http://one-api.bsg.world/api/messages

Request parameters:

ParameterRequiredTypeDefaultDescription
page[limit]NoInteger50The number of messages in the response. The parameter value range: min – 15, max – 500.
page[offset]NoInteger0Get messages starting from offset
filter[from]NoStringNoFilter by sending date “from”. Format ISO 8601: yyyy-mm-dd hh:mm:ss
filter[to]NoStringNowFilter by sending date “to”. Format ISO 8601: yyyy-mm-dd hh:mm:ss
filter[campaign_id]NoIntegerNoFilter to get messages by ID of campaign created using:
  • POST /api/campaigns/sms/send

  • POST /api/campaigns/sms/send-groups

  • POST /api/campaigns/sms/send-individual
filter[reference_id]NoStringNoFilter to get messages by external message ID
filter[id]NoIntegerNoGet a message by message ID
SortNoStringidSort by id, phone, delivered
WayNoStringascSorting options: asc, desc

Response parameters:

ParameterTypeDescription
idintegerMessage ID
campaign_idintegerCampaign ID
reference_idstringExternal message ID (reference)
typestringCampaign type: sms
sourcestringPossible values:
  • web

  • rest
textstringMessage text
phonestring
validityinteger
statusstringMessage status. Possible values:
  • delivered – message received by recipient

  • scheduled – message scheduled for sending

  • moderation – message in moderation

  • accepted – message accepted by operator

  • sending – message in the queue for sending

  • sent – message has been sent and is expecting to be delivered

  • expired – message not delivered – phone switched off

  • failed – message sending error (probably a missing prefix)

  • undelivered – message not delivered

  • unknown – no delivery report
amountobjectMessage price data:
valuestringMessage price
currencystringThe currency in which the message cost is specified. Format ISO 4217
senderstringSMS Sender name
created_atstringDate and time of the message creation. Format ISO 8601: yyyy-mm-dd hh:mm:ss
send_atstringDate and time the message was sent. Format ISO 8601: yyyy-mm-dd hh:mm:ss
delivered_atstringDate and time the delivery report was received. Format ISO 8601: yyyy-mm-dd hh:mm:ss

Response sample

If the request is successful, you will receive a response:

{
  "data": [
    {
      "id": 26130,
      "campaign_id": 1,
      "reference_id": "string",
      "type": "sms",
      "source": "web",
      "text": "text",
      "phone": 12345678900,
      "validity": 72,
      "status": "scheduled",
      "amount": {
        "value": "string",
        "currency": "UAH"
      },
      "sender": "sender",
      "created_at": "2021-04-27 19:44:06",
      "send_at": "2021-04-27 19:44:06",
      "delivered_at": "2021-04-27 19:44:06"
    }
  ],
  "meta": {
    "page": {
      "total": 1,
      "offset": 20,
      "limit": 40
    }
  }
}