Complete API documentation for integrating SMS Campaign services into your applications.
All API requests require authentication using Bearer tokens which are created after login the dashboard. Here's how to create a token the web platform: API Tokens->Create
Authenticate with your credentials to receive an API token.
Create an SMS campaign with your message and contacts.
Created campaigns are automatically send
Success message is returned with each contact having its send status
Create a new SMS campaign. SMS will be sent automatically.
Retrieve all campaigns for the authenticated user.
async function createAndSendCampaign() {
Create and send campaign
const campaignResponse = await fetch('http://smspop.co.zw/api/campaigns', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Welcome Campaign',
message: 'Hello! Welcome to our service.',
sender_id: 'BRAND1',
"contact_import_method":"manual",
manual_contacts: '263771234567, 263772345678',
})
});
const result = await campaignResponse.json();
console.log(result);
}
createAndSendCampaign();
<?php
Create and send campaign
$campaignData = [
'name' => 'Welcome Campaign',
'message' => 'Hello! Welcome to our service.',
'sender_id' => 'BRAND1',
"contact_import_method":"manual",
'manual_contacts' => '263771234567, 263772345678',
];
$ch = curl_init('http://smspop.co.zw/api/campaigns');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($campaignData));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $token
]);
$response = curl_exec($ch);
$result = json_decode($response, true);
print_r($result);
?>
import requests
import json
Create and send campaign
campaign_url = "http://smspop.co.zw/api/campaigns"
campaign_data = {
"name": "Welcome Campaign",
"message": "Hello! Welcome to our service.",
"sender_id": "BRAND1",
"contact_import_method":"manual",
"manual_contacts": "263771234567, 263772345678",
}
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
response = requests.post(campaign_url, json=campaign_data, headers=headers)
result = response.json()
print(json.dumps(result, indent=2))
Invalid or missing authentication token.
{"success":false,"message":"Insufficient credits. Please purchase more SMS credits"}
Not enough SMS credits to send the campaign.
{"success":false,"message":"Invalid sender ID"}
Invalid sender IDprovided for the campaign.
{"success":false,"message":"Your
account is inactive. Please contact support."}
Account is in the error disabled mode. Contact support.
{"success":false,"message":"Campaign
rejected: Content classified as political is not allowed"}
Campaign rejected due to content classification or user inactive. Category is displayed e.g. political
{"success":false,"message":"Validation
failed","errors":{"contact_import_method":["The contact import method field is
required."]}}
Invalid request data or missing required fields.
Our support team is here to help you integrate our API successfully.