Start sending SMS using our API
Integrate SMS functionality into your application using your programming language.
Base URL
All URLs referenced in the API documentation have the following base url.
https://portal.richmo.lk
Send a single message
Method 01 : Integration with Bearer authentication (token authentication)
HTTP request
GET /api/sms/send/
Parameters
HTTP request
Code Samples
curl --request GET 'https://portal.richmo.lk/api/sms/send/?dst=947xxxxxxxx&from=[mask]&msg=[UTF-8 URL Encoded Message]' --header 'Authorization: Bearer [API TOKEN]'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://portal.richmo.lk/api/sms/send/?dst=947xxxxxxxx&from=[mask]&msg=[UTF-8 URL Encoded Message]',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer [API TOKEN]'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://portal.richmo.lk/api/sms/send/?dst=947xxxxxxxx&from=[mask]&msg=[Your Message]"
payload={}
headers = {
'Authorization': 'Bearer [API TOKEN]'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Method 02 : Simple Integration - authentication token send via request parameters
HTTP request
GET /api/sms/send/
Parameters
Returns
Code Samples
curl --request GET 'https://portal.richmo.lk/api/v1/sms/send/?dst=947xxxxxxxx&from=[mask]&msg=[UTF-8 URL Encoded Message]&key=[API TOKEN]'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://portal.richmo.lk/api/v1/sms/send/?dst=947xxxxxxxx&from=[mask]&msg=[UTF-8 URL Encoded Message]&key=[API TOKEN]',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://portal.richmo.lk/api/v1/sms/send/?dst=947xxxxxxxx&from=[mask]&msg=[Your Message]&key=[API TOKEN]"
payload={}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Check Account Balance
HTTP request
GET /api/account/balance/
Parameters
Code Samples
ccurl --location --request GET 'https://portal.richmo.lk/api/account/balance' --header 'Authorization: Bearer [API TOKEN]'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://portal.richmo.lk/api/account/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer [API TOKEN]'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://https://portal.richmo.lk/api/account/balance"
payload={}
headers = {
'Authorization': 'Bearer [API TOKEN]'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)