Club Texting Bulk SMS Text Messaging API
Club Texting provides API via HTTP/ Internet Post.
The API calls can be made from nearly all popular programming language. We provide examples below in PHP and C#. You must first register an account to be able to use the API. To activate the API for your account please send a request to support@clubtexting.com with the username of your account.
Sending SMS Messages Via API | Receiving SMS Messages Via API | Carrier Lookup API
Sending SMS Messages Via API:
The text (sms) message sending API may be accessed via an HTTP call to the following web service URL:
https://app.clubtexting.com/apisendmessage.php
Parameters (may be passed via GET or POST and values must be properly URL encoded)
User |
(Required) Your Club Texting Username |
Pass |
(Required) Your Club Texting Password |
| PhoneNumber |
(Required) 10 digit phone number to send message to. |
Subject |
(Required) The subject of your message (leave null if no subject) |
Message |
(Required) The body of your message (cannot exceed 130 characters and contain single or double quotes) |
| Express |
(Optional) Use Express delivery method when sending message value = 1. Click here to see the difference between Express & Standard delivery.
What's the difference between Standard & Express delivery? |
The following are the codes that a send message API call can return. Any negative codes represent unsuccessful attempts to send messages.
1 |
Message Sent |
-1 |
Invalid user or password (make sure your account is API allowed) |
-2 |
Credit Limit Reached |
-5 |
Local Opt Out (the recipient/number is on your opt-out list.) |
-7 |
Invalid Message (message exceeds 130 characters or contains single or double quotes) |
-10 |
Unknown Error (please contact our support dept.) |
API Text Message Sending Language Examples:
PHP
<?php
$ch = curl_init('https://app.clubtexting.com/apisendmessage.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=username&pass=userpassword&phonenumber= 2127846500&subject=test&message=test message&express=0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$data = curl_exec($ch);
print($data); /* result of API call*/
?>
C#
string ret=string.Empty;
WebRequest w=WebRequest.Create("https://app.clubtexting.com/apisendmessage.php");
w.Method="POST";
w.ContentType="application/x-www-form-urlencoded";
using(Stream writeStream = w.GetRequestStream())
{
UTF8Encoding encoding = new UTF8Encoding();
byte[] bytes = encoding.GetBytes("user=username&pass=userpassword&
phonenumber=2127846500&subject=test
&message=test message&express=1");
writeStream.Write(bytes, 0, bytes.Length);
}
using (HttpWebResponse r = (HttpWebResponse) w.GetResponse())
{
using (Stream responseStream = r.GetResponseStream())
{
using (StreamReader readStream = new StreamReader (responseStream, Encoding.UTF8))
{
ret = readStream.ReadToEnd();
}
}
}
MessageBox.Show(ret); /* result of API call*/
Receiving SMS Messages Via API
The Club Texting SMS Server allows SMS messages to be received using HTTP through the means of keywords on our short code 25827. This page details the format of the HTTP requests which are send by the Club Texting SMS Server to allow the receipt of SMS text messages by external software systems.
The Club Texting SMS Server will push received SMS messages by making an HTTP GET to the provided URL to indicate the receipt of an SMS message. You can input this URL on the Keywords section of your Club Texting account.
Example URL:
http://www.yourdomain.com/receivesms.php
Message Format
On receipt of an SMS we will send an HTTP GET request to your server, using the parameters included in the table below:
| PhoneNumber |
10 digit phone number message originated from. |
Message |
The body of your message that was texted in by the originating phone number prefaced by your keyword. |
Example Request Sent:
http://www.yourdomain.com/receivesms.php?PhoneNumber=5554443333&Message=Hello%20my%20friend
Response To The Server
When the GET post is made to your server, your script must output your sms response in plain text format (max 130 characters) that will be sent back to the originating phone number through our 25827 shared short code. This response must be given in a timely manner (sub 60 seconds) or it will be abandoned. No additional calls to our servers are necessary.
Security Considerations
To ensure the authenticity of the HTTP requests you should only accept requests from the following Club Texting IP addresses:
* 66.148.74.128/130
The HTTP endpoint can be an HTTPS (SSL) URL to protect the data whilst in transit.
Receiving SMS Responses From Your Inbox
You may have replies that go into your Inbox sent to your server via the Forwarding option located on the left navigation of your clubtexting.com. You may specify a URL to send your responses to.
|