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 libraryvar 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);  });<?php// using SOAP Module - http://ca3.php.net/soap
class SMSParam {    public $CellNumber;    public $AccountKey;    public $MessageBody;    public $Reference;}
$client = new SoapClient('https://secure.smsgateway.ca/sendsms.asmx?WSDL');$parameters = new SMSParam;
$parameters -> CellNumber = destinationNumber;$parameters -> AccountKey = accountKey;$parameters -> MessageBody = "This is a demonstration of SMSGateway.ca using PHP5.";$parameters -> Reference = reference;
$Result = $client->LookupNumberThenSend($parameters);?>' Service Reference (SOAP)Using client = New SwiftSMS.SendSMSSoapClient    Dim response = client.LookupNumberThenSend(destinationNumber, messageBody,                    accountKey, reference)End Using
' WebClient (REST)Dim url = String.Format("https://secure.smsgateway.ca/services/message.svc/LookupNumberThenSend/{0}/{1}",                        accountKey, destinationNumber)Dim body = String.Format("{{ ""MessageBody"": ""{0}"", " & _                         "   ""Reference"" : ""{1}"" }}",                            messageBody, reference)
Using wClient = New Net.WebClient    wClient.Encoding = New UTF8Encoding()    wClient.Headers.Add("content-type", "application/json")
    Dim wResponse = wClient.UploadString(url, body)End UsingHTTP POST:curl -H "Content-Type: application/json" -X POST \     "https://secure.smsgateway.ca/services/message.svc/LookupNumberThenSend/[accountKey]/[destination]" \     --data "{\"MessageBody\": \"[messageBody]\", \"Reference\": \"[reference]\"}"// Service Reference / SOAPusing (var client = new SwiftSecure.SendSMSSoapClient()){    var response = client.LookupNumberThenSend(accountKey, phoneNumber, messageBody, reference);}
// Web Client / RESTdynamic body = new ExpandoObject();body.MessageBody = messageBody;body.Reference = reference;
var url = string.Format("https://secure.smsgateway.ca/services/message.svc/LookupNumberThenSend/{0}/{1}",    accountKey, destinationNumber);
using (var wClient = new System.Net.WebClient()){    wClient.Encoding = Encoding.UTF8;    wClient.Headers.Add("content-type", "application/json");
    string response = wClient.UploadString(url,        Newtonsoft.Json.JsonConvert.SerializeObject(body));}HTTP Request
POST:
/services/message.svc/LookupNumberThenSend/:accountKey/:destinationNumber| Parameter | Description | Location | 
|---|---|---|
| AccountKey | Your Swift SMS Gateway account key | URL | 
| DestinationNumber | Cell number to receive the text message | URL | 
| MessageBody | Body of the message to send | BODY | 
| Reference | Internal Reference ID | BODY | 
Returns
string
See SendMessage