Skip to content

GetUnsentMessages

Returns an array of unsent SMS Messages queued between the given dates

/// uses JQuery library
var postUrl =
'https://secure.smsgateway.ca/services/message.svc/' +
accountKey +
'/unsent/' +
messageStatus;
var body = JSON.stringify({
DateFrom: '2016-01-01',
DateTo: '2016-01-07',
});
$.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/unsent/:messageStatus
ParameterDescriptionLocation
accountKeyYour Swift SMS Gateway account keyURL
messageStatusThe status of the unsent message (1 = Pending, 2 = Time Restriction, 3 = Failed)URL
DateFromStart date of the date range to report onBODY
DateToEnd date of the date range to report onBODY

Returns

Array of SMSOutgoingMessage