smsales-api-docs

API Documentation on SMSALES

View the Project on GitHub SHIFTECH-AFRICA/smsales-api-docs

SMSALES API DOCS

How To Get Started

Generating Access Token GET

   https://api.smsales.co.ke/api/v1/token 
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.smsales.co.ke/api/v1/token',
    'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Basic ACCOUNT_API_TOKEN'
    }
}
{
  "data": {
    "Token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLnNtc2FsZXMuY28ua2VcL2FwaVwvdjFcL3Rva2VuIiwiaWF0IjoxNjIxOTY1OTk5LCJleHAiOjE2MjE5Njk1OTksIm5iZiI6MTYyMTk2NTk5OSwianRpIjoiNUlvc3NjdlRqZDU3bVdLcyIsInN1YiI6IjhiNWE5ZmEwLTM3ODYtNDRhOS05NmEwLWVlMTlmOTU2NDVjZiIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.mioHmrN-KJb8_rJd9FayfhBGI6G8Kg6g9nNg8c4GxjM",
    "TokenType": "Bearer",
    "Expires": 3600
  }
}

For more details see Account Api Token.

Fetching Latest Sent Sms’s GET

   https://api.smsales.co.ke/api/v1/sms
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.smsales.co.ke/api/v1/sms',
    'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Bearer GIVE_THE_GENERATED_BEARER_TOKEN'
    }
}

Getting Sms Units Account Balance GET

   https://api.smsales.co.ke/api/v1/sms/balance/account
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.smsales.co.ke/api/v1/sms/balance/account',
    'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Bearer GIVE_THE_GENERATED_BEARER_TOKEN'
    }
}

Getting Sms Units Sender ID Balance GET

   https://api.smsales.co.ke/api/v1/sms/balance/sender
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.smsales.co.ke/api/v1/sms/balance/sender',
    'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Bearer GIVE_THE_GENERATED_BEARER_TOKEN'
    }
}

Sending Bulk Sms POST

   https://api.smsales.co.ke/api/v1/sms/send

Params

{
  "api_sender" => "shiftech",// required check on your senderID's list for the API Sender
  "message" => "Hello Smsales.",// required
  "phone_numbers" => ["2547XXXXXXXX","2540XXXXXXXX","2547XXXXXXXX"],// required
  "scheduled_at" => "Y-m-d H:i:s", // optional
  "callback_url"=> "https://yourdomain/report"// optional this should be a POST request
}
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.smsales.co.ke/api/v1/sms/send',
    'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Bearer GIVE_THE_GENERATED_BEARER_TOKEN'
    },
body: JSON.stringify({"api_sender":"shiftech","message":"Hello","phone_numbers":["2547XXXXXXXX","2540XXXXXXXX","2547XXXXXXXX"]})

}
{
  "data": {
        "batch": "1DIIPJGDP4",
        "message": "Accepted for dispatch..."
  }
}

CallBack Results if provided.

{
  "sent":true,
  "sender":"SHIFTECH",
  "apiSender":"shiftech",
  "phoneNumbers":[
    "254XXXXXXXXX",
    "254XXXXXXXXX",
    "254XXXXXXXXX"
  ],
  "batch":"1DIIPJGDP4",
  "account":{
    "smsBalance":"663",
    "smsUsage":"24"
  }
}

Support or Contact

Having trouble with API integration? Check out our libraries or contact support and we’ll help you sort it out.