Send Batch SMS Messages
This document will describe how to send batch SMS messages.
Batch messages allows you to send up to 1,000 messages per Batch SMS request. These are useful for large campaigns.
POST
/send/batch
Send batch SMS messages to a number of receipients.
curl -X POST "https://api.mobivatebulksms.com/send/batch" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API KEY]' \
-d '{ "routeId": "mglobal", "messages": [ { "originator": "Brand", "recipient": "440000001", "text": "This is a test message" } ] }'
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer [API KEY]',
}
json_data = {
'routeId': 'mglobal',
'messages': [
{
'originator': 'Brand',
'recipient': '440000001',
'text': 'This is a test message',
},
],
}
response = requests.post('https://api.mobivatebulksms.com/send/batch', headers=headers, json=json_data)
# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "routeId": "mglobal", "messages": [ { "originator": "Brand", "recipient": "440000001", "text": "This is a test message" } ] }'
#response = requests.post('https://api.mobivatebulksms.com/send/batch', headers=headers, data=data)
Send a batch SMS message for later delivery
curl -X POST "https://api.mobivatebulksms.com/send/batch" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API KEY]' \
-d '{ "routeId": "mglobal", "scheduleDateTime": "2024-01-26T15:30:00+0530", "messages": [ { "originator": "Brand", "recipient": "440000001", "text": "This is a test message" } ] }'
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer [API KEY]',
}
json_data = {
'routeId': 'mglobal',
'scheduleDateTime': '2024-01-26T15:30:00+0530',
'messages': [
{
'originator': 'Brand',
'recipient': '440000001',
'text': 'This is a test message',
},
],
}
response = requests.post('https://api.mobivatebulksms.com/send/batch', headers=headers, json=json_data)
# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "routeId": "mglobal", "scheduleDateTime": "2024-01-26T15:30:00+0530", "messages": [ { "originator": "Brand", "recipient": "440000001", "text": "This is a test message" } ] }'
#response = requests.post('https://api.mobivatebulksms.com/send/batch', headers=headers, data=data)
Please note, to schedule a date time as a parameter, the date time parameter must be set to a time in the future.
Send a batch SMS message with a URL we want to shorten
curl -X POST "https://api.mobivatebulksms.com/send/batch" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API KEY]' \
-d '{ "routeId": "mglobal", "shortenUrls": true, "messages": [ { "originator": "Brand", "recipient": "440000001", "text": "Hey check out this cool video I found: https://vimeo.com/751393851?autoplay=1" } ] }'
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
}
json_data = {
'routeId': 'mglobal',
'shortenUrls': True,
'messages': [
{
'originator': 'Brand',
'recipient': '440000001',
'text': 'Hey check out this cool video I found: https://vimeo.com/751393851?autoplay=1',
},
],
}
response = requests.post('https://api.mobivatebulksms.com/send/batch', headers=headers, json=json_data)
# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "routeId": "mglobal", "shortenUrls": true, "messages": [ { "originator": "Brand", "recipient": "440000001", "text": "Hey check out this cool video I found: https://vimeo.com/751393851?autoplay=1" } ] }'
#response = requests.post('https://api.mobivatebulksms.com/send/batch', headers=headers, data=data)
Headers
Body
Name
Type
Required?
Description
A list of messages to send. See message arguments.
Campaign name, used for reporting purposes.
Default: false (URLs will not be shortened)
Set to true to shorten long URLs
Reduces message size and allows click tacking.
Default: true (Optouts are excluded)
Set to false to turn off Optout filtering.
Default: true (Duplicates are excluded)
Set to false if you wish to send multiple messages to the same recipient(s).
Default: null (Campaign is sent immediately)
Specify a date/time to schedule delivery at a later date
Example: 2024-01-26T15:30:00+0530
Arguments
Message Arguments are largely the same as when sending a single SMS message, see here.
Name
Type
Required?
Description
Originator/SenderID for SMS messages (MaxLength - AlphaNumeric: 11, numeric: 15).
Recipient of SMS Message (Numeric only, MSISDN format inc international prefix).
Your reference, will be provided as part of the delivery receipt for correlation.
Response
{
"id":"fd9157b74bd3475d8716a69683066f0f",
"name":null,
"routeId":"mglobal",
"shortenUrls":false,
"spreadHours":0,
"excludeOptouts":true,
"excludeDuplicates":false,
"scheduleDateTime":null,
"recipients":[
{
"originator":"Brand",
"recipient":"440000001",
"text":"Test Message",
"reference":"ref-001",
"routeId":null
}
]
}
{
"code":401,
"message":"Unauthorized"
}
Last updated