The Yoola SMS API is free. You only pay for the SMS you send. Here is how to send your first message.
Step 1: get your API key
Create a free account, sign in and open API Key in your dashboard. Keep the key private: anyone who has it can send SMS from your account.
Step 2: send with one request
Send a POST request with a JSON body:
curl --location 'https://yoolasms.com/api/v1/send' \
--header 'Content-Type: application/json' \
--data '{
"phone": "256704487563,256712345678",
"message": "Your Message",
"sender": "YoolaSMS",
"api_key": "YOUR_API_KEY_HERE"
}'
- phone: one or more numbers in international format, separated by commas.
- message: your text. One SMS holds 160 characters.
- sender: optional. Leave it out or use YoolaSMS if you do not have your own approved sender ID.
- api_key: your key from the dashboard.
The same thing in PHP
<?php
$payload = json_encode([
'phone' => '256704487563',
'message' => 'Your verification code is 482913',
'sender' => 'YoolaSMS',
'api_key' => 'YOUR_API_KEY_HERE',
]);
$ch = curl_init('https://yoolasms.com/api/v1/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
curl_close($ch);
Use your own sender ID
Once your own sender ID is approved and paid, put it in the sender field. A sender ID that is not approved on your account is refused, so a customer cannot send under someone else's name.
Good habits
- Never put your API key in a mobile app or in front-end JavaScript. Call the API from your server.
- Send one request with many numbers rather than one request per number.
- Keep messages inside 160 characters and avoid emojis, so each message is billed as one SMS.
Full documentation and code samples for PHP, Python, JavaScript, Node.js and Java are on our API page. There are also WordPress and WooCommerce plugins if you would rather not write code.
Comments (0)