In this tutorial, you'll learn how to send your first SMS message programmatically using the SMS Gateway Master API. We'll cover everything from installation to your first successful API call in just 5 minutes.
Prerequisites
Before we begin, make sure you have:
- Android device (version 5.0 or higher)
- Active SIM card with SMS capability
- Internet connection on your Android device
- Basic programming knowledge (optional but helpful)
Time required: 5-10 minutes
Difficulty: Beginner
Step 1: Install SMS Gateway Master
First, download and install SMS Gateway Master from the Google Play Store:
- Open Google Play Store on your Android device
- Search for "SMS Gateway Master"
- Tap Install
- Wait for installation to complete
- Tap Open to launch the app
Set as Default SMS App
When prompted, set SMS Gateway Master as your default SMS application:
- A dialog will appear asking to set as default
- Tap "Yes" or "Set as default"
- Grant necessary permissions (SMS, Phone, Notifications)
Note: Setting as default SMS app is required for sending messages. You can switch back to your previous SMS app anytime.
Step 2: Generate Your API Key
Each device has a unique API key for authentication. Here's how to get yours:
- Open SMS Gateway Master app
- Tap the ☰ menu icon (top left)
- Select Settings
- Tap API Key
- Your API key will be displayed
- Tap Copy to copy it to clipboard
Your API key looks like this:
sk_test_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
⚠️ Security Warning: Keep your API key secret! Never share it publicly or commit it to version control. Anyone with your API key can send SMS from your device.
Step 3: Make Your First API Call
Now for the exciting part - sending your first SMS programmatically! We'll show you three methods:
Method 1: Using cURL (Terminal/Command Line)
The simplest way to test the API is using cURL:
curl -X POST https://us-central1-sms-gateway-ae7e1.cloudfunctions.net/api_sms_send \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"to": "+1234567890",
"message": "Hello from SMS Gateway Master!"
}'
Replace:
YOUR_API_KEYwith your actual API key+1234567890with the recipient's phone number (include country code)
Method 2: Using JavaScript (Node.js or Browser)
// Node.js example
const fetch = require('node-fetch');
async function sendSMS() {
const response = await fetch(
'https://us-central1-sms-gateway-ae7e1.cloudfunctions.net/api_sms_send',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
to: '+1234567890',
message: 'Hello from SMS Gateway Master!'
})
}
);
const result = await response.json();
console.log(result);
// Output: { success: true, messageId: 'msg_abc123', status: 'sent' }
}
sendSMS();
Method 3: Using Python
import requests
def send_sms():
url = 'https://us-central1-sms-gateway-ae7e1.cloudfunctions.net/api_sms_send'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
data = {
'to': '+1234567890',
'message': 'Hello from SMS Gateway Master!'
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
# Output: {'success': True, 'messageId': 'msg_abc123', 'status': 'sent'}
if __name__ == '__main__':
send_sms()
Step 4: Verify SMS Delivery
After making the API call, you should see:
1. Successful API Response
{
"success": true,
"messageId": "msg_abc123xyz",
"status": "sent",
"timestamp": "2026-02-13T10:30:00Z"
}
2. Push Notification on Your Device
Your Android device will receive a push notification to send the SMS.
3. SMS Sent
The app will automatically send the SMS using your device's SMS manager.
4. Delivery Confirmation
Within seconds, you'll receive a delivery status update (if webhook configured).
Check your Android device's notification bar to see the delivery confirmation!
Troubleshooting Common Issues
❌ Error: "Invalid API Key"
Solution: Double-check your API key. Make sure you copied it correctly without extra spaces.
❌ Error: "Device offline"
Solution: Make sure your Android device has an active internet connection.
❌ Error: "Invalid phone number"
Solution: Use international format with country code (e.g., +1234567890).
❌ SMS not sending
Solution: Check that SMS Gateway Master is set as your default SMS app and has necessary permissions.
What's Next?
Congratulations! You've successfully sent your first SMS via API. Here's what to explore next:
- Complete API Documentation - Explore all API endpoints and features
- Webhook Tutorial - Set up delivery status notifications
- OTP Implementation Guide - Build a complete OTP verification system
- API Best Practices - Learn error handling and rate limiting
🚀 Ready to Build Something Amazing?
Start your 7-day free trial with 100 SMS per day. No credit card required.
Start Free Trial View Full Documentation