MENU navbar-image

Introduction

API Documentation

This documentation provides comprehensive information for developers looking to integrate with our SMS messaging API. Before using the API, you must create an account to obtain your credentials (username and password). Here, you'll find everything you need to understand the API's capabilities, including endpoints, request and response formats, authentication methods, and more.

Send SMS Message API

Endpoint

POST /v1/sms/send

Description

This endpoint allows you to send SMS messages to multiple recipients. Users can provide their credentials via URL parameters or form parameters.


Authentication

Credentials

Users must provide the following credentials for authentication:

Credentials can be passed either as URL parameters or form parameters.


Request Parameters

Body Parameters

Parameter Type Required Description
numbers string Yes The phone numbers to send the message to. Comma separated. Example: 0701234567, 0712345678
message_body string Yes The content of the message to be sent. Example: "Hello, this is a test message."
username string Yes Your username for authentication. Example: "user123"
password string Yes Your password for authentication. Example: "pass123"

Responses

Success Response


400 Bad Request

{ "error": "Invalid phone number format." }


401 Unauthorized

{ "error": "Unauthorized." }


Explanation of Sections

  1. Endpoint: Specifies the URL and method used to access the API.
  2. Description: Provides a brief overview of what the endpoint does.
  3. Authentication: Details the credentials needed for access.
  4. Request Parameters: Lists the body parameters that can be sent with the request, including their types and descriptions.
  5. Responses: Describes the possible responses, including success and error responses with example JSON outputs.
  6. Notes: Additional information relevant to the API usage.

Endpoints

Display Swagger API page.

Example request:
curl --request GET \
    --get "http://localhost/api/v2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Server Error"
}
 

Request      

GET api/v2

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Display Oauth2 callback pages.

Example request:
curl --request GET \
    --get "http://localhost/api/oauth2-callback" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/oauth2-callback"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
content-type: text/html; charset=UTF-8
cache-control: no-cache, private
access-control-allow-origin: *
 

<!doctype html>
<html lang="en-US">
<body>
<script src="oauth2-redirect.js"></script>
</body>
</html>

 

Request      

GET api/oauth2-callback

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/v2/sms/send

Example request:
curl --request GET \
    --get "http://localhost/api/v2/sms/send" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v2/sms/send"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
 

{
    "error": "API key is required",
    "help": "Provide X-API-Key header or api_key parameter"
}
 

Request      

GET api/v2/sms/send

POST api/v2/sms/send

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/v2/account/balance

Example request:
curl --request GET \
    --get "http://localhost/api/v2/account/balance" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v2/account/balance"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
 

{
    "error": "API key is required",
    "help": "Provide X-API-Key header or api_key parameter"
}
 

Request      

GET api/v2/account/balance

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/generate-key

Example request:
curl --request POST \
    "http://localhost/api/generate-key" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"expiry_days\": 3
}"
const url = new URL(
    "http://localhost/api/generate-key"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "expiry_days": 3
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/generate-key

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

expiry_days   integer  optional  

Must be at least 1. Must not be greater than 365. Example: 3

POST api/revoke-key

Example request:
curl --request POST \
    "http://localhost/api/revoke-key" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/revoke-key"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/revoke-key

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/regenerate-key

Example request:
curl --request POST \
    "http://localhost/api/regenerate-key" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"expiry_days\": 9
}"
const url = new URL(
    "http://localhost/api/regenerate-key"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "expiry_days": 9
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/regenerate-key

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

expiry_days   integer  optional  

Must be at least 1. Must not be greater than 365. Example: 9