GetSentMessagesAfterID
Returns an array of (at most 1000) sent SMS Messages with IDs greater than the given one.
// uses JQuery libraryvar postUrl = 'https://secure.smsgateway.ca/services/message.svc/' + accountKey + '/afterId/' + messageNumber;
$.ajax({ url: postUrl, method: 'GET', contentType: 'application/json;charset=UTF-8',}) .done(function (response) { alert(response); }) .error(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); });<?php// using SOAP Module - http://ca3.php.net/soap
class SMSParam { public $AccountKey; public $MessageNumber;}
$client = new SoapClient('https://secure.smsgateway.ca/sendsms.asmx?WSDL');$parameters = new SMSParam;
$parameters -> AccountKey = accountKey;$parameters -> MessageNumber = messageNumber;
$Result = $client->GetSentMessagesAfterID($parameters);?>' Service Reference (SOAP)Using client = New SwiftSMS.SendSMSSoapClient Dim response = client.GetSentMessagesAfterID(accountKey, messageCount)End Using
' WebClient (REST)Dim url = String.Format("https://secure.smsgateway.ca/services/message.svc/{0}/afterId/{1}", accountKey, messageNumber)
Using wClient = New Net.WebClient wClient.Encoding = New UTF8Encoding() wClient.Headers.Add(HttpRequestHeader.ContentType, "application/json")
Dim wResponse = wClient.DownloadString(url)End Usingcurl "https://secure.smsgateway.ca/services/incoming.svc/[accountKey]/afterId/[messageNumber]"// Service Reference / SOAPusing (var client = new SwiftSecure.SendSMSSoapClient()){ var messages = client.GetSentMessagesAfterID(accountKey, messageNumber);}
// Web Client / RESTvar url = string.Format("https://secure.smsgateway.ca/services/message.svc/{0}/afterId/{1}", accountKey, messageCount);
using (var wClient = new System.Net.WebClient()){ wClient.Encoding = Encoding.UTF8; wClient.Headers.Add(HttpRequestHeader.ContentType, "application/json");
var messages = wClient.DownloadString(url);}HTTP Request
GET:
/services/message.svc/:accountKey/afterId/:messageCount| Parameter | Description | Location |
|---|---|---|
| accountKey | Your Swift SMS Gateway account key | URL |
| messageId | The unique Message ID of the SMS to retrieve messages after | URL |
Returns
Array of SMSOutgoingMessage