API used to send an SMS message
Use the SMS Send Message API to send an SMS message
The SMS Send Message API is used to send an SMS message from a DialogTech SMS enabled tracking number, to a 3rd party recipient.
Base URL for SMS Send Message
Rate Limits
The SMS API enforces the following rate-limits
- 40 sms per number per 60 seconds
- 4 sms per DialogTech account per second
- 1 sms per number per second
Parameter List
Parameter | Required | Accepts | Max Length | Notes | Usage |
---|---|---|---|---|---|
action | Yes | String: sms.send_message | n/a | Only accepts sms.send_message to send an SMS Message | Defines the API Call as "SMS Send Message" type |
access_key | Yes | String | n/a | Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
secret_access_key | Yes | String | n/a | Secret Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
to | Yes | String: Unformatted Phone Number | n/a | Can be any unformatted phone number | Defines the start of the date-range for records to be returned from |
from | Yes | String: Unformatted Phone Number | n/a | Must be a DialogTech SMS enabled tracking number | Defines the end of the date-range for records to be returned from |
message | Yes | String | 256 | DialogTech does not limit / break texts into smaller batches messages. This behavior is dependent on the recipient's carrier | Defines the message being send to the third party. |
Using this API
These code examples are meant to show a basic method of accessing DialogTech's IVR Report API.
<?php
/*
SMS Send Message EX:
This example will send an SMS with
the text 'Thank you for calling.'
to a predefined number and echo the
verbatim XML response.
*/
// Create cURL resource
$ch = curl_init();
$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
// API Specific Static Parameters
$action = "sms.send_message";
// Required User Parameters To Request the API
$access_key = "foo";
$secret_access_key = "bar";
$to = "5556667777";
$from = "5554332111"; // This is a DialogTech SMS-Enabled Tracking Number in the account
$message = "Thank%20you%20for%20calling.";
// Construct the full URL
$full_url = $baseuri . "&action=" . $action .
"&access_key=" . $access_key .
"&secret_access_key=" . $secret_access_key .
"&to=" . $to .
"&from=" . $from .
"&message=" . $message;
// Set the URL
curl_setopt($ch, CURLOPT_URL, $full_url);
// Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Sets the $output variable to the result of the curl
$output = curl_exec($ch);
// Close curl resource to free up system resources
curl_close($ch);
// Echo the XML response to the page
echo $output;
?>
Example Response
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE response [
<!ELEMENT response (result,result_description)>
<!ELEMENT result (#PCDATA)>
<!ELEMENT result_description (#PCDATA)>
]>
<response>
<result>success</result>
<result_description>[1] Message Sent</result_description>
</response>