Skip to content

SendBulkMessage

Sends an SMS message to all the cell numbers provided (maximum of 5000). Returns the number of messages successfully queued, or an error message on failure.

// uses JQuery library
var postUrl = "https://secure.smsgateway.ca/services/message.svc/"
+ accountKey + "/Bulk";
var body = JSON.stringify({
MessageBody: "Message Body",
Reference: "Reference Number",
CellNumbers: [destinationNumber, destinationNumber, ...]
});
$.ajax({
url: postUrl,
method: "POST",
contentType: "application/json;charset=UTF-8",
data: body
}).done(function(response) {
alert(response);
}).error(function (xhr, textStatus, errorThrown) {
alert (xhr.responseText);
});

HTTP Request


POST:
/services/message.svc/:accountKey/Bulk

ParameterDescriptionLocation
AccountKeyYour Swift SMS Gateway account keyURL
MessageBodyBody of the message to sendBODY
ReferenceInternal Reference IDBODY
CellNumbersArray of cell numbers to deliver SMS messages toBODY

Returns

string

If successful, will return x messages queued successfully

If unsuccessful, will return an error message (See (SendMessage))