#Send bulk messages

  • Send messages in bulk on Twilio SMS, Twilio WhatsApp or Gupshup WhatsApp channel.
  • You can also send an image, a video or a file.
  • Calling this API will create a bulk messaging job, which you can also see and update on app.sociocs.com -> Bulk messaging -> History.

#Method

POST

#Path

/messages/bulk

#Body parameters

NameValueData typeRequired?
providertwlo (for Twilio SMS),
twlowa (for Twilio WhatsApp),
gswa (for Gupshup WhatsApp)
StringYes
channel_keyChannel key value from Profile & settings -> APIStringYes
recipientsArray of object {to: "phone_number", name: "recipient_name"}StringYes
textMessage textStringNo (when image_url, image_urls or file_url is present)
image_urlPublicly accessible image URLStringNo (when text, video_url or file_url is present)
video_urlPublicly accessible video URLStringNo (when text, image_url or file_url is present)
file_urlPublicly accessible file URLStringNo (when text, image_url or video_url is present)
duplicates_allowedtrue - Send message to duplicate phone numbers (if there are any),
false - Send message only once per phone number (first occurrence)
BooleanNo (defaults to false)
scheduleISO 8601 date & time (e.g., "2006-01-02T15:04:05-04:00"). If the value is in the past, messages will be sent immediately.StringNo
user_idSociocs user ID to show that user as sender of the message. When not provided, message is show as sent by Sociocs API. Use /team-members endpoint to find out User IDs.StringNo

#Response

#HTTP status codes

CodeRemarks
200Request was successful.
400Validation error or request body was incorrectly formatted.
401Authentication failed. Check apikey header.
404Requested API endpoint not found.
429The rate limit has been reached.
500-511There was a problem processing the request on our server. Try again later.

#Response object

NameValueRemarks
statussuccess or error-
errorsArray of object { msg: [error detail] }Only present when status is error.
dataObject { job_id: [bulk messaging job id] }Only present when status is success.

#Code sample

curl --location --request POST 'https://api.sociocs.com/messages/bulk' \ --header 'apikey: your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "provider": "twlo", "channel_key": "your_channel_key", "recipients": [ { "to": "phone_number_1", "name": "recipient_name_1" }, { "to": "phone_number_2", "name": "recipient_name_2" } ], "text": "message", "schedule: "2023-12-25T11:00:00-04:00" }'