1. Get Your API Credentials
First, you need to obtain your API credentials from the MackSMS portal:
API Credentials Setup
1. Login to your MackSMS account 2. Navigate to System Settings → API Configuration 3. Click Request API settings 4. Your API credentials will be displayed, they are both md5 encoded strings: - API Username: your_secret_key - Password: your_secret_code - API Key: your_account_api_key 5. Base Endpoint: https://macksms.co.tz/portal/api/
2. Send Your First SMS
Here's a basic example using cURL to send an SMS:
cURL Example
curl -X POST https://macksms.co.tz/portal/api/text \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "single_sms",
"sender_id": "MackSMS",
"phone": "0629833155",
"message": "Trial SMS from MackSMS API service"
}'
3. Check the Response
Successful API calls return a JSON response like this:
API Response
{
"success": true,
"sms_data": [
{
"action_status": true,
"sender": "MackSMS",
"phone": "255629833155",
"text": "Trial SMS from MackSMS API service",
"sms_count": 1,
"messageID": 708285840899124900,
"status": "SENT",
"description": "Message sent to next instance",
"action_date_time": "2025-03-22 13:55:17"
}
]
}
}