|
Technical Details for Remote textback manipulation
Our system only allows HTTP Post style connections (we do not allow HTTP Get as
there are restrictions on the amount of data allowed to be sent at one time.
| Our Gateway addresses |
| Unencrypted |
http://www.sms2email.com/sms/tbgate.php |
| Encrypted |
https://www.sms2email.com/sms/tbgate.php |
| Required Variable Names |
|
| username |
sms2email.com username |
| password |
sms2email.com password |
| cmd |
The command that you wish to carry out - detailed below |
| keyword |
The keyword you wish to add / edit / delete |
Note -The cmd keyword_list does not require the keyword field
to be sent.
Each command for the system has its own required variables. These are detailed
on the form below:
| acl_add - Add a Mobile number to a keyword's
ACL (Access Control List) |
|
| variable |
description |
| mobnumber |
The mobile number to add to the ACL
(Must be in the form countrycode+areacode (without leading zero)+number.
For example: 447740123456 or 31712312312 |
| acl_delete - Remove a mobile number from
a keyword's ACL (Access Control List) |
|
| variable |
description |
| mobnumber |
The mobile number to add to the ACL
(Must be in the form countrycode+areacode (without leading zero)+number.
For example: 447740123456 or 31712312312 |
| confirm |
To confirm removal, set this variable to yes |
| acl_enable - Enable the Access Control List on the keyword |
|
| acl_disable - Disable the Access Control List on the
keyword |
|
| acl_list - List the numbers set in the ACL for the keyword |
|
| infoword_add - Add an Infoword responder
to a keyword |
|
| variable |
description |
| infoword |
The name of the infoword - ie. "keywordname infowordname" |
| response |
The response to the infoword |
| infoword_edit - Edit an Infoword responder
associated to a keyword |
|
| variable |
description |
| infoword |
The name of the infoword - ie. "keywordname infowordname" |
| response |
The response to the infoword |
| infoword_delete - Remove an Infoword
responder associated to a keyword |
|
| variable |
description |
| infoword |
The name of the infoword - ie. "keywordname infowordname" |
| confirm |
To confirm removal, set this variable to yes |
| infoword_list - List Infoword's under a keyword |
|
| keyword_add - Add a keyword |
|
| variable |
description |
| action |
The type of keyword (store,email,httppost,infoemail,infoword) |
| emailaddress |
*Only used for actions: email and infoemail |
| httpposturl |
*Only used for action: httppost - Must begin with http |
| response |
*Only used for actions: infoemail and infoword |
| keyword_edit - Edit a keyword associated
with your account |
|
| variable |
description |
| action |
The type of keyword (store,email,httppost,infoemail,infoword) |
| emailaddress |
*Only used for actions: email and infoemail |
| httpposturl |
*Only used for action: httppost - Must begin with http |
| response |
*Only used for actions: infoemail and infoword |
| keyword_delete - Remove a keyword associated
with your account |
|
| variable |
description |
| confirm |
To confirm removal, set this variable to yes |
| keyword_list - List all keywords under the account name |
|
| keyword_query - List all details associated with the
keyword |
|
Gateway Response Messages
| Response Code |
Description |
| AQSMS-ACK |
Our Server has acknowledged the command and has been processed successfully |
| AQSMS-ACL_NOT_ACTIVE |
The ACL (Access Control List) has not been enabled on the Keyword - see
the command ACL_ENABLE |
| AQSMS-AUTHDETAILS_NOT_SENT |
The authenication variables were not detected |
| AQSMS-AUTH_ERROR |
The username and password provided could not be validated. Please check
and retry |
| AQSMS-DATA |
Output data will follow on new lines below using \n as a carriage return |
| AQSMS-HTTPPOSTURL_NOT_SENT |
The http post url variable was not detected |
| AQSMS-INFOWORD_EXISTS |
An infoword with the same name was detected under the keyword |
| AQSMS-INVALID_ACTION |
An invalid action was provided. A list of valid action's is shown above |
| AQSMS-INVALID_CMD |
An invalid command was provided. A list of valid command's is shown above |
| AQSMS-INVALID_EMAILADDRESS |
An invalid email address was provided. Please check and try again |
| AQSMS-INVALID_HTTP_POST_URL |
An invalid http post url was provided. NB: It must begin with http://
or https:// |
| AQSMS-INVALID_INFOWORD |
An infoword containing non-alphanumeric characters was detected. Please
check and try again |
| AQSMS-INVALID_KEYWORD |
A keyword containing non-alphanumeric characters was detected. Please
check and try again |
| AQSMS-INVALID_MOBNUMBER |
The mobile number field only accepts numeric entries. Please check and
try again |
| AQSMS-KEYWORD_LIMIT_REACHED |
The keyword limit set on your account has been reached. Contact us via
www.sms2email.com to increase this limit |
| AQSMS-KEYWORD_NOT_SENT |
The keyword variable was not detected |
| AQSMS-KEYWORD_EXISTS |
The keyword requested already exists. It may be owned by another user |
| AQSMS-MOBNUMBER_NOT_EXISTS |
The mobile number field is required and was not filled in |
| AQSMS-NO_GET |
A HTTP Get request was detected which is not allowed. Only HTTP Post are
allowed |
| AQSMS-NOT_CONFIRMED |
A delete command was detected without the use of the confirm field. |
| AQSMS-NOT_OWNER |
The username and keyword combination did not find a valid keyword (may
not exist or keyword is owned by other user) |
| AQSMS-NUMBER_EXISTS |
The mobile number sent already exists in the ACL |
| AQSMS-RESERVED_KEYWORD |
The keyword requested is reserved. Contact us via www.sms2email.com for
more details |
| AQSMS-RESPONSE_NOT_SENT |
The response field is required and was not filled in |
| AQSMS-SVRERROR-1 |
A connection could not be made to the Main DB Server |
| AQSMS-SVRERROR-2 |
A connection could not be made to the Textback Server |
| AQSMS-SVRERROR-3 |
A database action failed |
Example use of Gateway
An example use of the interface would be to add the keyword, testing123
as an infoword, to have a default response of "Your test was successful!".
Below is a step by step process of how it would be completed:
| Variables to be posted |
| username |
testing123 |
| password |
testing321 |
| action |
keyword_add |
| keyword |
testing123 |
| defaultresp |
Your test was successful! |
If that data were posted to the server at: https://www.sms2email.com/sms/tbgate.php,
the server would respond with a status message (Detailed above). In this case,
the server replied with:
This is because someone already has the keyword, testing123
on our system. In which case, changing it to testing321 and
attempting to add again resulted in the server replying with:
The server has now acknowledged the request, and the keyword has been registered.
Example Script (using php with curl extensions)
<?php
// sms2email.com account details:
$username = "test123";
$password = "321test";
// Command Details
$keyword = "testing123";
$command = "keyword_add";
$action = "infoword";
$defaultresp = "Your test was successful!";
// Put post fields variable together
$postfields = "username=$username&password=$password&";
$postfields .= "cmd=$command&action=$action&response=$defaultresp";
// initialise Curl
$tbpost = curl_init();
// Set Curl Option: URL = https://www.sms2email.com/sms/tbgate.php
curl_setopt($tbpost, CURLOPT_URL, "https://www.sms2email.com/sms/tbgate.php");
// Set Curl Option: Post style request = true
curl_setopt($tbpost, CURLOPT_POST, 1);
// Set Curl Option: Collect result from script
curl_setopt($tbpost, CURLOPT_RETURNTRANSFER, 1);
// Set Curl Option: Set timeout to 15 seconds
curl_setopt($tbpost, CURLOPT_TIMEOUT, 15);
// Set Curl Option: Post data
curl_setopt($tbpost, CURLOPT_POSTFIELDS, $postfields);
// Execute Request, and store result in $tb_post
$tbpost_result = curl_exec ($tbpost);
// Close Curl
curl_close ($tbpost);
// Show result to screen
echo $tbpost_result;
?>
|