Skip to content

LookupNumberThenSend

Performs a lookup on the given number and only if the number is wireless, an SMS is sent. Returns Message queued successfully on successful send, or an error message (see SendMessage) on failure.

// uses JQuery library
var postUrl =
'https://secure.smsgateway.ca/services/message.svc/LookupNumberThenSend/' +
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/LookupNumberThenSend/:accountKey/:destinationNumber
ParameterDescriptionLocation
AccountKeyYour Swift SMS Gateway account keyURL
DestinationNumberCell number to receive the text message URL
MessageBodyBody of the message to sendBODY
ReferenceInternal Reference IDBODY

Returns

string

See SendMessage