Skip to main content

Send a campaign

Endpoint: https://BASE_URL/api/sms/campaigns/send Request Type: POST Body params:
OptionsRequiredDescription
api_keyyesstring
Your API key (It can be found on your Termii dashboard)
country_codeyesstring
Represents short numeric geographical codes developed to represent countries (Example: 234 ) .
sender_idyesstring
Represents the ID of the sender which can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (Example:CompanyName)
messageyesstring
Text of a message that would be sent to the destination phone number
channelyesstring
This is the route through which the message is sent. It is either dnd, whatsapp, or generic
message_typeyesstring
The type of message that is sent, which is a plain message.
phonebook_idyesstring
ID of the phonebook selected
schedule_sms_statusnostring
To send a scheduled campaign, pass scheduled as the value
schedule_timenostring
The time to send scheduled campaign. This is required if scheduled_sm_status is scheduled
{
"api_key":"Your API KEY",
"country_code":"234",
"sender_id" : "Termii",
"message":"Welcome to Termii.", 
"channel": "generic",
"message_type": "Plain", 
"phonebook_id": "2d9f4a02-85b8-45e5-9f5b-30f93ef472e2",
"delimiter":",",
"remove_duplicate":"yes",
"campaign_type":"personalized",
"schedule_time":"30-06-2021 6:00",
"schedule_sms_status":"scheduled"
}
Response
    {
        "message": "Your campaign has been scheduled"
    }   

Fetch campaigns

Endpoint: https://BASE_URL/api/sms/campaigns?api_key=Your API KEY Request Type: GET Response
   {
    "data": [
        {
            "campaign_id": "C60e30b2c806da",
            "phone_book": "test",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2022-07-05 00:00:00",
            "status": "Scheduled",
            "created_at": "2021-07-05T13:37:48.000000Z"
        },
        {
            "campaign_id": "C60e306e63478d",
            "phone_book": "test",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2022-07-05 00:00:00",
            "status": "Scheduled",
            "created_at": "2021-07-05T13:19:34.000000Z"
        },
        {
            "campaign_id": "C60e306c106c21",
            "phone_book": "test",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2022-07-05 00:00:00",
            "status": "Scheduled",
            "created_at": "2021-07-05T13:18:57.000000Z"
        },
        {
            "campaign_id": "C60e2f2a4782b8",
            "phone_book": "test",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-07-22 00:00:00",
            "status": "Scheduled",
            "created_at": "2021-07-05T11:53:08.000000Z"
        },
        {
            "campaign_id": "C60ddda932de77",
            "phone_book": "test",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-07-22 00:00:00",
            "status": "Scheduled",
            "created_at": "2021-07-01T15:09:07.000000Z"
        },
        {
            "campaign_id": "C60ddda80ea6cc",
            "phone_book": "test",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-07-22 00:00:00",
            "status": "Scheduled",
            "created_at": "2021-07-01T15:08:48.000000Z"
        },
        {
            "campaign_id": "C60dc5a8437e63",
            "phone_book": "adeyinka",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-06-30 06:00:00",
            "status": "Scheduled",
            "created_at": "2021-06-30T11:50:28.000000Z"
        },
        {
            "campaign_id": "C60db3fc2954a0",
            "phone_book": "adeyinka",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-06-29 05:00:00",
            "status": "Scheduled",
            "created_at": "2021-06-29T15:44:02.000000Z"
        },
        {
            "campaign_id": "C60db3f70c8df9",
            "phone_book": "-",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-06-29 05:00:00",
            "status": "Pending",
            "created_at": "2021-06-29T15:42:40.000000Z"
        },
        {
            "campaign_id": "C60db3ef5a3ceb",
            "phone_book": "-",
            "sender": "Termii",
            "camp_type": "scheduled",
            "channel": "-",
            "total_recipients": 0,
            "run_at": "2021-06-29 05:00:00",
            "status": "Pending",
            "created_at": "2021-06-29T15:40:37.000000Z"
        },
        {
            "campaign_id": "C5dbae7faa2b65",
            "phone_book": "-",
            "sender": "Termii",
            "camp_type": "regular",
            "channel": "Sms",
            "total_recipients": 2,
            "run_at": "2019-10-31 15:56:10",
            "status": "Delivered",
            "created_at": "2019-10-31T14:56:10.000000Z"
        }
    ],
    "links": {
        "first": "https://BASE_URL/api/sms/campaigns?page=1",
        "last": "https://BASE_URL/api/sms/campaigns?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://BASE_URL/api/sms/campaigns",
        "per_page": 15,
        "to": 11,
        "total": 11
    }
}  

Fetch campaign history

Endpoint: https://BASE_URL/api/sms/campaigns/campaign_id?api_key=Your API KEY Request Type: GET Response
{
  "data": [
    {
      "id": 64,
      "sender": "Termii",
      "receiver": "2347089509657",
      "message": "Hi This is from Termii Campaign",
      "message_abbreviation": "Hi This is from Termii Campaign",
      "amount": 1,
      "channel": "Generic",
      "sms_type": "plain",
      "message_id": "0011551727393226622357573897694282599004522965786793671662369098835884420487860904021011663",
      "status": "Sent",
      "date_created": "2020-01-26 07:24:29",
      "last_updated": "2020-01-26 07:24:29"
    }
  ],
  "links": {
    "first": "https://BASE_URL/api/sms/campaigns/C5dbae7faa2b65?page=1",
    "last": "https://BASE_URL/api/sms/campaigns/C5dbae7faa2b65?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https://BASE_URL/api/sms/campaigns/C5dbae7faa2b65",
    "per_page": 15,
    "to": 1,
    "total": 1
  }
}