The method allows you to get information about the status of a single message or the status of each message in an SMS campaign.
| GET http://one-api.bsg.world/api/messages |
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| page[limit] | No | Integer | 50 | The number of messages in the response. The parameter value range: min – 15, max – 500. |
| page[offset] | No | Integer | 0 | Get messages starting from offset |
| filter[from] | No | String | No | Filter by sending date “from”. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
| filter[to] | No | String | Now | Filter by sending date “to”. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
| filter[campaign_id] | No | Integer | No |
Filter to get messages by ID of campaign created using:
|
| filter[reference_id] | No | String | No | Filter to get messages by external message ID |
| filter[id] | No | Integer | No | Get a message by message ID |
| Sort | No | String | id | Sort by id, phone, delivered |
| Way | No | String | asc | Sorting options: asc, desc |
| Parameter | Type | Description | |
| id | integer | Message ID | |
| campaign_id | integer | Campaign ID | |
| reference_id | string | External message ID (reference) | |
| type | string | Campaign type: sms | |
| source | string |
Possible values:
|
|
| text | string | Message text | |
| phone | string | ||
| validity | integer | ||
| status | string |
Message status. Possible values:
|
|
| amount | object | Message price data: | |
| value | string | Message price | |
| currency | string | The currency in which the message cost is specified. Format ISO 4217 | |
| sender | string | SMS Sender name | |
| created_at | string | Date and time of the message creation. Format ISO 8601: yyyy-mm-dd hh:mm:ss | |
| send_at | string | Date and time the message was sent. Format ISO 8601: yyyy-mm-dd hh:mm:ss | |
| delivered_at | string | Date and time the delivery report was received. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
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
}
}
}