Developer API Documentation
Use the Digital Verse API to send SMS directly from your own websites, applications or any systems.
Getting your API key
- Login to your dashboard.
- Navigate to the API Keys / Integration section.
- Copy your API Key and keep it safe. Treat it like a password.
Base URL
The base URL for sending SMS from your website is:
https://your-site-domain.com/api_send_sms.php
Replace your-site-domain.com with the actual domain or IP where this integration is hosted.
HTTP Parameters
Make an HTTP POST request to the API endpoint with the following parameters:
api_key– Your secret API key generated in the dashboard.sender_id– Approved sender name for your account.to– Recipient phone number(s). Use comma‑separated values for multiple numbers.message– The SMS text you want to send.
Sample PHP integration
<?php
// Example of sending SMS from a website using Digital Verse API
$endpoint = 'https://your-site-domain.com/api_send_sms.php';
$postData = [
'api_key' => 'YOUR_API_KEY_HERE',
'sender_id'=> 'HCMTest',
'to' => '2348012345678,2348098765432',
'message' => 'Hello from your website via Digital Verse!'
];
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));
$response = curl_exec($ch);
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
} else {
echo 'API response: ' . $response;
}
curl_close($ch);
?>
Sample JavaScript (fetch) integration
fetch('https://your-site-domain.com/api_send_sms.php', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
api_key: 'YOUR_API_KEY_HERE',
sender_id: 'HCMTest',
to: '2348012345678',
message: 'Hello from JavaScript using Digital Verse API!'
})
})
.then(function (response) { return response.text(); })
.then(function (data) {
console.log('API response:', data);
})
.catch(function (error) {
console.error('Error:', error);
});
Handling responses
Depending on how api_send_sms.php is implemented in your installation, you may receive:
- A success status and message ID for each SMS.
- An error code and description when something goes wrong (invalid key, low units, invalid numbers, etc.).
Check your specific implementation or documentation in the admin panel for the exact response format.