NAV Navbar

Introduction

Welcome to the Wasiliana API! You can use our API to access Wasiliana API endpoints, which can get information on various services in our database, USSD, SMS, Voice, Airtime

We have language bindings in PHP, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

Wasiliana uses API keys to allow access to the API. You can register a new Wasiliana API key at our developer portal, under your Project.

Wasiliana expects for the API key to be included in all API requests to the server in a request body that looks like the following:

apiKey: API-KEY

USSD

Sent Request

 {
  "sessionId":["SESSION_ID"],
  "phoneNumber":"25472x xxx xxx",
  "serviceCode" : "CODE",
  "text":"USSD_PARAMS"
 }

Expected Response

Headers

 Content-Type: "application/json"
 apiKey: "[random-key]"

POST https://api.wasiliana.com//api/safaricom/ussd/receiver?sessionId=00000&serviceCode=123&phoneNumber=25472xxxxxxx&text=EndHelloworld

Params


  "sessionId" :"00000",
  "phoneNumber" :"25472x xxx xxx",
  "serviceCode" : "123",
  "text" :"End Hello world"

A USSD service code is needed to be registered with us at the developer portal

A call back URL is needed so that we send requests whenever they come in from a client

A HTTP POST Request is sent to your server with the following parameters :

Parameters

Parameter Description
sessionId Unique number generated for each session and used to identify users interacting with the system
phoneNumber The phone number of the client using your USSD application
serviceCode The network(Safaricom, Airtel or Telkom) USSD code
text This is basically the user input

SMS

This endpoint receives SMS requests from the developer.

Alphanumeric

POST https://api.wasiliana.com/api/v1/developer/send/sms

Headers

 Content-Type: "application/json"
 apiKey: "[random-key]"

Body

 {
  "recipients":["25472x xxx xxx"],
  "from":"company-x",
  "message" : "Merry Christmas from company-x",
  "linkid":"optional field"
 }

The above command returns JSON structured like this:

{
    "status": "success",
    "data": "Successfully Dispatched the sms to process"
}

An alphanumeric short message service(SMS) refers to a custom branded SMS for your company.That is: Allows the sender to send messages using a custom ID constructed from a combination of alpha and numeric characters and spaces. e.g All your customers can receive messages from your company, with the company name as the heading of the sms.

HTTP Request

POST

https://api.wasiliana.com/api/v1/developer/send/sms

URI Parameters

Parameter Type Description
recipients required The phoneNumber of the client sending an sms request
from required The Sender ID
message required The message being transmitted
linkid optional field returned when a user initiates an sms

Bulk SMS - Send request

POST https://api.wasiliana.com/api/v1/developer/sms/bulk/send/sms/request

Headers

 Content-Type: "application/json"
 apiKey: "[random-key]"

Body

 {
  "recipients":["25472x xxx xxx"],
  "from":"company-x",
  "message" : "Merry Christmas from company-x",
  "linkid":"optional field"
 }

The above command returns JSON structured like this:

{
    "status": "success",
    "data": "Successfully Dispatched the sms to process"
}

A unique number sequence that identifies you to the customers you contact via SMS. A short code is a 4,5 or 6-digit number that can send and receive messages with mobile phones..

HTTP Request

POST

https://api.wasiliana.com/api/v1/developer/sms/bulk/send/sms/request

URI Parameters

Parameter Type Description
recipients required The phoneNumber of the client sending an sms request
from required The Sender ID
message required The message being transmitted
linkid optional field returned when a user initiates an sms

ShortCode

POST https://api.wasiliana.com/api/v1/developer/sms/bulk/send/sms/request

Headers

 Content-Type: "application/json"
 apiKey: "[random-key]"

Body

 {
  "recipients":["25472x xxx xxx"],
  "from":"company-x",
  "message" : "Merry Christmas from company-x",
  "linkid":"optional field"
 }

The above command returns JSON structured like this:

{
    "status": "success",
    "data": "Successfully Dispatched the sms to process"
}

A unique number sequence that identifies you to the customers you contact via SMS. A short code is a 4,5 or 6-digit number that can send and receive messages with mobile phones..

HTTP Request

POST

https://api.wasiliana.com/api/v1/developer/sms/bulk/send/sms/request

URI Parameters

Parameter Type Description
recipients required The phoneNumber of the client sending an sms request
from required The Sender ID
message required The message being transmitted
linkid optional field returned when a user initiates an sms

On-Demand SMS

POST https://api.wasiliana.com/api/v1/developer/sms/bulk/send/sms/request

Headers

 Content-Type: "application/json"
 apiKey: "[random-key]"

Body

 {
  "recipients":["25472x xxx xxx"],
  "from":"company-x",
  "message" : "Reply to ....",
  "linkid":"requred field"
 }

The above command returns JSON structured like this:

{
    "status": "success",
    "data": "Successfully Dispatched the sms to process"
}

An SMS short code is needed to be registered with us at the developer portal

A call back URL is needed so that we send requests whenever they come in from a client, and the appropriate responses sent back to them

A HTTP POST Request is sent to your server with the following parameters :

Parameters

Parameter Type Description
recipients required The phoneNumber of the client sending an sms request
from required The Sender ID
message required The message being transmitted
linkid required field returned when a user initiates an sms

Delivery Reports

Request Body


 {
     "phone":"25472x xxx xxx",
     "correlator":"message_15883801465eacc1f2643a9",
     "deliveryStatus":"0",
     "failure_reason":""
}

A call back URL is needed so that we send requests whenever an sms has been deliverd to the client

Errors

The Wasiliana API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The request has an escalated access.
404 Not Found -- The specified resource could not be found.
405 Method Not Allowed -- You tried to access an endpoint with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
429 Too Many Requests -- You're beyond your request limit.!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.