DOCUMENTATION

Specification Documentation, Version 1.0


Documentation

Welcome to CB Messaging

This document provides you details on API usage and integration

Introduction

An API is simply that which connects your code to our Gateway. It has been designed to make it easy for you to integrate into your apps, which is why it's the developers choice

 

Few Things To Know

Our API is organised around using HTTP verbs and REST. Our API accepts and returns JSON formatted payload.

The prerequisite of using this API is to have an account with CBMessaging, visit CBMessaging registration page to create your account for free.

Unless otherwise stated, the base url to be used is https://cbmessaging.com/api

Sender ID

Sender IDS or Names are identities that indicates the sender of the message in other words who is sending the message

 

Fetch Account SenderIDs

This API is used in fetching available sender IDS that are linked to the provided account

Endpoint : https://cbmessaging.com/api/sms/sender-id?api_key=api-key

Request Type : GET

Sample Response:

[

    {
        "sender_id""Cibaworld",
        "status""approved",
        "created""2021-06-23 06:14:36"
    },
    {
        "sender_id""Lavciba",
        "status""pending",
        "created""2021-06-24 15:12:26"
    }
]

SMS Messaging

Sending messages with our API is very easy. It offers a way to send messages to your customers or partners using a POST Request.

The API accepts JSON request payload and returns JSON encoded response.

 

Sending Message (POST)

 

Options Required Description
api_key (string) yes Your generated api key which can be found when you explore your profile
senderID (string) yes Sender ID which has been approved by CBMessaging 
to (string) yes Number(s) to which the message will be delivered e.g. (026 354 8521). Multiple numbers should eb separated by a comma(,) e.g 0263548521,0544874686
msg (string) yes This is the content of the message to be delivered. 
at (datetime) no This option gives you the flexibility of scheduling the message, thus choose when the message is to be delivered to the recipients.

 

Sample Response:

 {

    "success"1,
    "message_id"23,
    "message""Message Successfully Queued",
    "total_cost""0.021",
    "balance""2.341",
    "reference""6TnFNMpDfv"
}

PHP Examples

PHP Examples

The examples below show you how you can use the APIs provided for your work

 

Sending Message

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://cbmessaging.com/api/v1/sms/send-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>' {
          "to": "09999999999",
           "from": "Coldsis",
           "content": "Hi there, CBMessaging is Awesome ",
           "api_key": "Your API Key",  
       }',
CURLOPT_HTTPHEADER => array(
  'Content-Type: application/json'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Documentation

Home

Dashboard