Developer Docs

Table of contents

Get a list of SMS campaigns

The method for getting a list of created campaigns.

The maximum period for which you can sample the campaigns is 3 months.

Request URL

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

Request parameters

ParameterRequiredTypeDefaultDescription
filter[type]NostringsmsFilter by campaign type, sms
filter[from]Nostringfilter[to] -3 monthDate and time of the sampling beginning. Format ISO 8601: yyyy-mm-dd hh:mm:ss
filter[to]NostringnowDate 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]Noint0Get messages starting from offset
page[limit]Noint50Number of campaigns in response
sortNostringidSort by id, sender, type
wayNostringascSorting options: asc, desc

Response parameters

ParameterTypeDescription
idintegerCampaign ID created using:
  • POST /api/campaigns/sms/send

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

  • POST /api/campaigns/sms/send-individual
namestringCampaign name
senderstringSMS Sender name
statusstringCampaign current status. Possible values:
  • creation – created

  • spam – campaign did not pass moderation

  • scheduled – campaign is scheduled

  • sending – campaign began to be sent

  • paused – campaign is paused

  • stopped – campaign is stopped

  • done – campaign is completed
message_typestringCampaign type: sms
start_atstringCampaign start date. Format ISO 8601: yyyy-mm-dd hh:mm:ss
real_start_atstringActual campaign start date and time. Format ISO 8601: yyyy-mm-dd hh:mm:ss
finished_atstringCampaign completion date. Format ISO 8601: yyyy-mm-dd hh:mm:ss
created_atstringDate and time when the campaign was created. Format ISO 8601: yyyy-mm-dd hh:mm:ss
statisticsobjectCampaign messages statistics:
deliveredintegerTotal number of messages delivered to recipients within the campaign
sentintegerTotal number of messages sent to recipients within the campaign

Response sample

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
    }
  }
}