Skip to content

SendMessageExtended

Sends an SMS message to the given phone number. Returns an instance of an SMSSendMessageResponse.

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

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

Returns

SMSSendMessageResponse

>

Message Type Description
ErrorMessagestring

Empty if successful, description (see SendMessage) if failure

MessageIDlongUnique Message ID of queued message
MessagesRemainingintCredits remaining on your account
QueuedSuccessfullybooleanTrue if message was queued