Developer Docs

Table of contents

Cancel SMS Campaign

The method allows you to cancel the SMS campaign sent via the API.

Cancellation is possible only for a campaign that is in the creation / paused / sending / scheduled status.

Request URL

PATCH  http://one-api.bsg.world/api/campaigns/{id}/stop

Request parameters:

ParameterRequiredTypeDefaultDescription
idYesintegerNoThe ID of the campaign created using:
  • POST /api/campaigns/sms/send

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

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

Response parameters:

ParameterTypeDescription
idintegerID of the task created for a bulk campaign
namestringCampaign name
senderstringSMS Sender name
statusstringCampaign 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
mesage_typestringCampaign type: sms
start_atstringDate and time of the campaign start (scheduled). Format ISO 8601: yyyy-mm-dd hh:mm:ss
real_start_atstringActual date and time the campaign started. Format ISO 8601: yyyy-mm-dd hh:mm:ss
finished_atstringDate and time the campaign is completed. Format ISO 8601: yyyy-mm-dd hh:mm:ss
created_atstringDate and time the campaign is created. Format ISO 8601: yyyy-mm-dd hh:mm:ss
statisticsarrayCampaign statistics:
deliveredintegerTotal number of messages delivered within the campaign
sentintegerTotal number of messages sent within the campaign

Response sample:

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

We use cookies (and other similar technologies) to collect data to improve your experience on our site. By using our website, you’re agreeing to the collection of data as described in our Website Data Collection Policy.