Skip to content

SendMessageWithReference

Sends an SMS message to the given phone number. Allows adding a Reference which can be used in the future to retrieve outgoing information or incoming replies.

// uses JQuery library
var postUrl =
'https://secure.smsgateway.ca/services/message.svc/' +
accountKey +
'/' +
destinationNumber;
var body = JSON.stringify({
MessageBody: 'Message Body',
Reference: 'reference',
});
$.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/:destinationNumber

ParameterDescriptionLocation
AccountKeyYour Swift SMS Gateway account keyURL
DestinationNumberCell number to receive the text messageURL
MessageBodyBody of the message to sendBODY
ReferenceInternal Reference IDBODY

Returns

string

See (SendMessage)