📦
Mobivate Bulk API Documentation
  • 👋Welcome to BulkSMS
  • AUTHENTICATION & INTEGRATION
    • Getting started with Integration
      • Creating a New API Key
      • Get API Key
      • Test API Key
    • Registering Webhooks
      • Delivery Receipt Notification
      • Incoming Message Notification
      • Short URL Click Notification
    • Understanding Response Codes
  • USE CASES
    • Send Single SMS Message
      • Understanding SMS Response Codes
    • Send Batch SMS Messages
      • Understanding Batch SMS Response Codes
    • Search Message logs
    • Search for Single Message log
    • List OptOuts
    • Add an OptOut
    • Delete an OptOut
    • Frequently Asked Questions
  • 📚Integrations
    • Integrating Mobivate framework into your own application
    • Automate SMS messages using events through Zapier
    • Asynchronous Number Verification
    • Synchronous Number Verification
    • Adding / Removing Contacts
    • Creating New Contact Group
  • 🔓ARCHIVED DOCS
    • Sending simple Notification messages
    • Sending SMS from 3rd Party Providers
    • Sending Campaigns
Powered by GitBook
On this page

Was this helpful?

  1. USE CASES

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

Header
Value

Content-Type

application/json

Authorization

Bearer [Api-Key]

Body

Name
Type
Required?
Description

routeId

string

Yes

Route for messages.

messages

string

Yes

A list of messages to send. See message arguments.

name

string

No

Campaign name, used for reporting purposes.

shortenUrls

boolean

No

Default: false (URLs will not be shortened) Set to true to shorten long URLs Reduces message size and allows click tacking.

excludeOptouts

boolean

No

Default: true (Optouts are excluded) Set to false to turn off Optout filtering.

excludeDuplicates

boolean

No

Default: true (Duplicates are excluded) Set to false if you wish to send multiple messages to the same recipient(s).

scheduleDateTime

datetime

No

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

Name
Type
Required?
Description

originator

string

Yes

Originator/SenderID for SMS messages (MaxLength - AlphaNumeric: 11, numeric: 15).

recipient

string

Yes

Recipient of SMS Message (Numeric only, MSISDN format inc international prefix).

body

string

Yes

Message text.

routeID

string

No

Specified message route.

reference

string

No

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"
}
PreviousUnderstanding SMS Response CodesNextUnderstanding Batch SMS Response Codes

Last updated 1 year ago

Was this helpful?

Message Arguments are largely the same as when sending a single SMS message, .

see here