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:
- Username (string): Your username for authentication.
- Password (string): Your password 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
- Code:
200 OK - Content:
{ "message": "Message sent successfully." }
400 Bad Request
{ "error": "Invalid phone number format." }
401 Unauthorized
{ "error": "Unauthorized." }
Explanation of Sections
- Endpoint: Specifies the URL and method used to access the API.
- Description: Provides a brief overview of what the endpoint does.
- Authentication: Details the credentials needed for access.
- Request Parameters: Lists the body parameters that can be sent with the request, including their types and descriptions.
- Responses: Describes the possible responses, including success and error responses with example JSON outputs.
- 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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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>
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.