Developer Docs
The method for getting a list of created campaigns.
The maximum period for which you can sample the campaigns is 3 months.
GET http://one-api.bsg.world/api/campaigns |
Parameter | Required | Type | Default | Description |
filter[type] | No | string | sms | Filter by campaign type, sms |
filter[from] | No | string | filter[to] -3 month | Date and time of the sampling beginning. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
filter[to] | No | string | now | Date and time of the sampling end. Format ISO 8601: yyyy-mm-dd hh:mm:ss It is possible to specify a future date: the valid value is 30 days ahead of the current date. |
page[offset] | No | int | 0 | Get messages starting from offset |
page[limit] | No | int | 50 | Number of campaigns in response |
sort | No | string | id | Sort by id, sender, type |
way | No | string | asc | Sorting options: asc, desc |
Parameter | Type | Description | |
id | integer | Campaign ID created using:
| |
name | string | Campaign name | |
sender | string | SMS Sender name | |
status | string | Campaign current status. Possible values:
| |
message_type | string | Campaign type: sms | |
start_at | string | Campaign start date. Format ISO 8601: yyyy-mm-dd hh:mm:ss | |
real_start_at | string | Actual campaign start date and time. Format ISO 8601: yyyy-mm-dd hh:mm:ss | |
finished_at | string | Campaign completion date. Format ISO 8601: yyyy-mm-dd hh:mm:ss | |
created_at | string | Date and time when the campaign was created. Format ISO 8601: yyyy-mm-dd hh:mm:ss | |
statistics | object | Campaign messages statistics: | |
delivered | integer | Total number of messages delivered to recipients within the campaign | |
sent | integer | Total number of messages sent to recipients within the campaign |
If the request is successful, you will receive a response:
{
"data": [
{
"id": 1,
"name": "string",
"sender": "string",
"status": "creation",
"message_type": "sms",
"start_at": "2021-04-27 19:44:06",
"real_start_at": "2021-04-27 19:44:06",
"finished_at": "2021-04-27 19:44:06",
"created_at": "2021-04-27 19:44:06",
"statistics": {
"delivered": 0,
"sent": 0
}
}
],
"meta": {
"page": {
"total": 1,
"limit": 30,
"offset": 0
}
}
}