Sending SMS Messages |
Sends individual SMS text messages via the short code 88202. Accepts GET or POST requests. |
URL |
https://app.tellmycell.com/api/sending/ Example call: https://app.tellmycell.com/api/sending/?user=USERNAME&pass=PASSWORD &phonenumber=PHONENUMBER&subject=SUBJECT&message=MESSAGE |
Parameters |
|
User |
(Required) Your TellMyCell username |
Pass |
(Required) Your TellMyCell password |
PhoneNumber | (Required) 10 digit phone number to send message to |
Subject |
(Optional) The subject of your message up to 13 characters |
Message |
(Required) The body of your message |
Note: Values must be properly URL encoded |
|
|
Return Values |
|
1 |
Message sent |
-1 |
Invalid user and/or password or API is not allowed for your account |
-2 |
Credit limit reached |
-5 |
Local opt out (the recipient/number is on your opt-out list.) |
-7 |
Invalid message or subject (exceeds maximum number of characters and/or contains invalid characters - see a list of valid characters below) |
-104 |
Globally opted out phone number (the phone number has been opted out from all messages sent from our short code) |
-106 |
Incorrectly formatted phone number (number must be 10 digits) |
-10 |
Unknown error (please contact our support dept.) |
Note: Messages cannot exceed 160 characters combined subject and message field. Subjects are always limited to 13 characters |
|
Note: The list of allowed characters for messages and subjects is: a-z, A-Z, 0-9 and these special characters: .,:;!?()~=+-_\/@$#&%'" |
|
Note: The following characters count as two characters when used: \r \n |
|
Note: To opt back in a globally opted out number (return value -104) please text your Keyword to 88202 using that phone. |
API Text Message Sending Language Examples:
PHP
<?php
$ch=curl_init('https://app.tellmycell.com/api/sending');
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,"user=username&pass=userpassword&phonenumber= 2125551234&subject=test&message=test message");
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.tellmycell.com/api/sending");
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=2125551234&subject=test
&message=test message");
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*/
PHP - Send Multiple Messages
<?php
/* The below code snippet is a sample and not functional. Its purpose is to illustrate how to send multiple requests to our service using one connection */
= curl_init('https://app.tellmycell.com/api/sending');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
foreach ( as ) {
= "user=username&pass=userpassword&phonenumber=" . $message['phone'] . "&subject=" . $message['subject'] . "&message=" . $message['message'];
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$data = curl_exec($ch);
}
curl_close($ch);
?>
Return Values |
|
Any non-negative number |
The amount of credits available |
-1 |
Invalid user or password (make sure your account is API allowed) |
-10 |
Unknown Error (please contact our support dept.) |
|
Return Values |
|
1 |
The keyword is available |
0 |
The keyword is not available |
-1 |
Invalid user or password (make sure your account is API enabled) |
-2 |
Request declined because it is less than $5.00 minimum purchase. |
-10 |
Unknown Error (please contact our support dept.) |
|
Return Values |
|
1 |
The request succeeded |
0 |
The request was declined |
-1 |
Invalid user or password (make sure your account is API allowed) |
-10 |
Unknown Error (please contact our support dept.) |
|
Return Values |
|
2 |
The request succeeded |
1 |
The keyword is not available |
0 |
The request was declined |
-1 |
Invalid user or password (make sure your account is API allowed) |
-10 |
Unknown Error (please contact our support dept.) |
|
API Rent A Keyword Language Examples:
PHP
<?php
$ch=curl_init('https://app.tellmycell.com/api/keyword/setup/');
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,"user=username&pass=userpassword&group=test&url=http://test.com/test");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$data = curl_exec($ch);
print($data); /* result of API call*/
?>
Return Values |
|
1 |
Updated Successfully |
-1 |
Invalid user or password (make sure your account is API allowed) |
-2 |
Invalid Keyword |
-3 |
Invalid Group Name |
-4 |
Invalid Email |
-5 |
Invalid URL |
-7 |
Invalid autoreply message (message is blank or message exceeds maximum number of characters or message contains invalid characters) |
-10 |
Unknown Error (please contact our support dept) |
|