https://www.titanly.net/api/sms/addSms.php
Send Message
Sending SMS messages is our primary feature. Below is a set the dataset and examples needed in order to send messages programmactically.
Name | Status | Description |
---|---|---|
To | Required | The phone number you sending to, this can be used in conjunction with "Contact", or "Group". OR it can be used to replace "Contact" or "Group". |
Message | Required | The message to be sent. |
Contact | Optional | The contact ID from our contact system that you want to send the message to, this can be used in conjunction with "To", or "Group". OR it can be used to replace "To" or "Group". |
Group | Optional | The contact ID from our contact system that you want to send the message to, this can be used in conjunction with "To", or "Contact". OR it can be used to replace "To" or "Contact". |
From | Optional | The phone number that you are send the message from. This phone number must be a phone number in our system. If you do not assign this value, the system will attempt to choose a number from your list. We highly recommend filling this out, however you do not have to. |
API Key | Required | Your API key found in your account area. |
Name | Status | Description |
---|---|---|
MessageId | Payload | After queueing the message, the MessageId will be returned for your records. |
Base Example
PHP
<?php //Setup Variables $url = "https://www.titanly.net/api/sms/addSms.php"; $fields['To'] = urlencode('To Phone Number'); $fields['From'] = urlencode('From Phone Number'); $fields['Message'] = urlencode("Your Message"); $fields['ApiKey'] = urlencode('Your API Key'); $fieldString = ''; foreach($fields as $key=>$value) { $fieldString .= $key.'='.$value.'&'; } rtrim($fieldString, '&'); // Use Curl To send the reqeust $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldString); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); $userData = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); ?>
Base Payload
Payload
<Root> <response>success</response> <message> </message> <Data> <messageId>1234</messageId> </Data> </Root>