SMS Guide

Start sending SMS using our API | Check account balance

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

Note : All the query string parameters in the URL must be UTF-8 URL Encoded

Check account balance

HTTP request

GET /api/account/balance/

Parameters

No need additional parameters.

Returns

Code Description Message Example
200 Success {“message”:”success”,”balance”:250.0}
401 Unauthorized : Errors like invalid token { “detail”: “Invalid token.” }

Code Samples

Curl

curl --location --request GET 'https://portal.richmo.lk/api/account/balance' --header 'Authorization: Bearer [API TOKEN]'

PHP Curl

$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;

Python – Request

 


import requests

url = "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)

Leave a Reply

Your email address will not be published. Required fields are marked *