ProTexting.com API Documentation

Sending SMS Messages Via API

Sending Text Message API can be accessed via HTTPS (HTTP over Secure Socket Layer - SSL) thru the following URL:
https://api.protexting.com/sendmessage.php

The following text parameters are available:

(can be passed via POST or GET)

•    All parameters are required!

Option 1 (using username and password)

user
your ProTexting username
password
your ProTexting password
number 11 digit mobile number to send message, you must include 1 before the 10 digit number
message
your message, not exceeding 148 characters and URL properly encoded

Option 2 (using key parameter – recommended)

key
your ProTexting Security Key
number 11 digit mobile number to send message, you must include 1 before the 10 digit number
message
your message, not exceeding 148 characters and URL properly encoded

Instructions for the message:

  • The message must be properly URL encoded (eg the %20 rather than a space).
  • Message CAN contain any of the following characters: a-z, A-Z, 0-9 and special characters. Please review our list of Allowed Characters .
  • The following characters count as two characters when used in the message: € f [ ] ^ { | } ~ . View detailed list »
  • For security reasons, our servers limit the number of connections to 200 HTTP connections per server per minute. 
  • API Instructions on using CURL SSL Certification Check on your server

Send message API call return codes:

* Negative code represent failure to send message

1
Message Sent
-2
Invalid user or password
-3
Incorrect phone number, make sure the mobile number is 11 digit.  You need to enter 1 before the 10 digit phone number
-4
Invalid message:  message exceeds 148 characters or invalid characters. Please review our list of Allowed Characters .
-5
Recipient has opted out from your list
-6
Global opt-out.  The recipient has asked not to receive any messages from our short code
-7
Credit limit reached
-8
Your IP address is not allowed
-9
There are forbidden words to send out, please review our list of Forbidden Words and Phrases.
-100
Unknown error

API Text Message Sending Examples:

Option 1 – EXAMPLE  - (using username and password)

PHP

$ch=curl_init('https://api.protexting.com/sendmessage.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"user=username&password=password&number=12345678910&message=test message");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data; 

/* result of API call*/

?>

Option 2 – EXAMPLE  - (using key parameter – recommended)

PHP

$ch=curl_init('https://api.protexting.com/sendmessage.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"key=yourapikey&number=12345678910&message=test message");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data; 

/* result of API call*/

?>

Receiving SMS Messages Via API

Our servers allow SMS to be send to your sever using HTTP protocol.  After we receive the SMS to our short code via your dedicated keyword, you can access the SMS using the following example:

http://www.yourdomain.com/receivemessage.php


We will send an HTTP GET request to your server upon receiving an SMS to your keyword following the two parameters below:

number 11 digit phone number message originated from.
message
 
The body of your message that was texted in by the originating phone number prefaced by your keyw

keyword

 

 

Only shown if there is auto-reply message set up for a particular keyword, and if there is a reply to the auto-reply generated by the recipient. It is to be used if you need to know which keyword’s auto-reply message the recipient replied to.

Example:
  • User text’s in with a keyword
  • Receives an auto-reply asking for more info or an answer
  • Recipient replies without starting the message with your keyword
  • You get the message with parameter “keyword” and can process it for the correct keyword which initiated the communication string.
carrierCell phone (mobile) carrier of the person sending the text message
carrier_code Carrier Code. For more information about carriers' codes click here >>

Example Request Sent:
http://www.yourdomain.com/receivemessage.php?number=12345678910&message=Hello&keyword=mykeyword&carrier_code=mobilecarriercode&carrier=mobilecarrier

Sending SMS Messages with XML Response Via API

Sending Text Message API with XML Response can be accessed via HTTPS thru the following URL:
https://api.protexting.com/sendmessagexml.php

The following text parameters are available:

(can be passed via POST or GET)

•    All parameters are required!

Option 1 (using username and password)

user
your ProTexting username
password
your ProTexting password
number 11 digit mobile number to send message, you must include 1 before the 10 digit number
message
your message, not exceeding 148 characters and URL properly encoded

Option 2 (using key parameter – recommended)

key
your ProTexting Security Key
number 11 digit mobile number to send message, you must include 1 before the 10 digit number
message
your message, not exceeding 148 characters and URL properly encoded

Instructions for the message:

  • The message must be properly URL encoded (eg the %20 rather than a space).
  • Message CAN contain any of the following characters: a-z, A-Z, 0-9 and special characters. Please review our list of Allowed Characters .
  • The following characters count as two characters when used in the message: € f [ ] ^ { | } ~ . View detailed list »
  • For security reasons, our servers limit the number of connections to 200 HTTP connections per server per minute.  

Send message API call return codes:

* Negative code represent failure to send message

1
Message Sent
-2
Invalid user or password
-3
Incorrect phone number, make sure the mobile number is 11 digit.  You need to enter 1 before the 10 digit phone number
-4
Invalid message:  message exceeds 148 characters or invalid characters. Please review our list of Allowed Characters .
-5
Recipient has opted out from your list
-6
Global opt-out.  The recipient has asked not to receive any messages from our short code
-7
Credit limit reached
-8
Your IP address is not allowed
-9
There are forbidden words to send out, please review our list of Forbidden Words and Phrases.
-100
Unknown error

API Text Message Sending Examples:

Option 1 – EXAMPLE  - (using username and password)

PHP

$ch=curl_init('https://api.protexting.com/sendmessagexml.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"user=username&password=password&number=12345678910&message=test message");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data; 

/* XML result of API call*/

?>

Option 2 – EXAMPLE  - (using key parameter – recommended)

PHP

$ch=curl_init('https://api.protexting.com/sendmessagexml.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"key=yourapikey&number=12345678910&message=test message");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data; 

/* XML result of API call*/

?>

Example XML Response :

<?xml version="1.0" ?>

<response code="1" status="success">

    <comment>

        <![CDATA[ Message Sent  ]]></comment>

        <message_id>12345</message_id>

</response>

Message Details Via API

Message Details can be accessed via HTTPS thru the following URL:
https://api.protexting.com/messagedetails.php

The following text parameters are available:

(can be passed via POST or GET)

•    All parameters are required!

Option 1 (using username and password)

user
your ProTexting username
password
your ProTexting password
message_id message id which was recieved from Sending SMS Messages with XML Response

Option 2 (using key parameter – recommended)

key
your ProTexting Security Key
message_id message id which was recieved from Sending SMS Messages with XML Response

Message Details API call return codes:

* Negative code represent failure to send message

1
Message Details was received successfully
-2
Invalid user or password
-3
Invalid message id
-100
Unknown error

API Receive Text Message Details Examples:

Option 1 – EXAMPLE  - (using username and password)

PHP

$ch=curl_init('https://api.protexting.com/messagedetails.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"user=username&password=password&message_id=12345");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* XML result of API call*/

?> 

Option 2 – EXAMPLE  - (using key parameter – recommended)

 PHP

$ch=curl_init('https://api.protexting.com/messagedetails.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"key=yourapikey&message_id=12345");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* XML result of API call*/

?> 

Example XML Response:

<?xml version="1.0" ?>

<response code="1" status="success">

    <comment>

        <![CDATA[ Message Details was received successfully ]]>

    </comment>

<message_details>

    <message_id>12345</message_id>

    <message_number>12345678910</message_number>

    <message_content>

        <![CDATA[ API Test Message ]]>

    </message_content>

    <message_date>2010-11-08 09:33:39</message_date>

</message_details>

<delivery_report>

    <delivery_status>DELIVERED</delivery_status>

</delivery_report>

<carrier_report>

    <carrier_code>TMOBILEUS</carrier_code>

    <carrier_name>

        <![CDATA[ T-Mobile USA ]]>

    </carrier_name>

    <carrier_deliveryreport_delivered>Yes</carrier_deliveryreport_delivered>

    <carrier_deliveryreport_rejected>Yes</carrier_deliveryreport_rejected>

    <carrier_deliveryreport_failed>Yes</carrier_deliveryreport_failed>

</carrier_report>

</response>

For more information about carriers' codes and delivery reports, click here >>

Check Keyword Availability Via API

Check Keyword API can be accessed via HTTPS thru the following URL:
https://api.protexting.com/checkkeyword.php

The following text parameters are available:

(can be passed via POST or GET)

•    All parameters are required!

Option 1 (using username and password)

user
your ProTexting username
password
your ProTexting password
keyword check if a keyword is available

Option 2 (using key parameter – recommended)

key
your ProTexting Security Key
keyword check if a keyword is available

Check Keyword API call return codes:

* Negative code represent failure to send message

1
The keyword is available
0
The keyword is not available
-2
Invalid user or password
-3
Incorrect keyword format: Keyword should contains only letters and digits. Total number of characters must be between 4 and 50
-8
Your IP address is not allowed
-100
Unknown error

API Check Keyword Availability Examples:

Option 1 – EXAMPLE  - (using username and password)

PHP

$ch=curl_init('https://api.protexting.com/checkkeyword.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"user=username&password=password&keyword=mykeyword");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* result of API call*/

?>

Option 2 – EXAMPLE  - (using key parameter – recommended)

PHP

$ch=curl_init('https://api.protexting.com/checkkeyword.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"key=yourapikey&keyword=mykeyword");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* result of API call*/

?>

Reserve Keyword Via API

Reserve Keyword API can be accessed via HTTPS thru the following URL:
https://api.protexting.com/addkeyword.php

The following text parameters are available:

(can be passed via POST or GET)

•    All parameters are required!

Option 1 (using username and password)

user
your ProTexting username
password
your ProTexting password
keyword keyword to be reserved
autoreplymessage (optional) Auto Reply Message

Option 2 (using key parameter – recommended)

key
your ProTexting Security Key
keyword keyword to be reserved
autoreplymessage (optional) Auto Reply Message

Instructions for the message:

  • Auto Reply Message must be properly URL encoded (eg the %20 rather than a space).
  • Auto Reply Message CAN contain any of the following characters: a-z, A-Z, 0-9 and special characters. Please review our list of Allowed Characters .
  • The following characters count as two characters when used in the message: € f [ ] ^ { | } ~ . View detailed list »

 

Reserve Keyword API call return codes:

* Negative code represent failure to send message

1
The keyword is available
0
The keyword is not available
-2
Invalid user or password
-3
Incorrect keyword format: Keyword should contains only letters and digits. Total number of characters must be between 4 and 50
-4
There is no keyword credits
-5
 Invalid Auto Reply Message:  message exceeds 135 characters or invalid characters. Please review our list of Allowed Characters
-8
Your IP address is not allowed
-9
There are forbidden words included in the message, please review our list of Forbidden Words and Phrases
-100
Unknown error

API Reserve Keyword Examples:


Option 1 – EXAMPLE  - (using username and password)

PHP

$ch=curl_init('https://api.protexting.com/addkeyword.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"user=username&password=password&keyword=mykeyword&autoreplymessage=Hello");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* result of API call*/

?>

Option 2 – EXAMPLE  - (using key parameter – recommended)

PHP

$ch=curl_init('https://api.protexting.com/addkeyword.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"key=yourapikey&keyword=mykeyword&autoreplymessage=Hello");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* result of API call*/

?>

Remove Keyword Via API

Remove Keyword API can be accessed via HTTPS thru the following URL:
https://api.protexting.com/deletekeyword.php

The following text parameters are available:

(can be passed via POST or GET)

•    All parameters are required!

Option 1 (using username and password)

user
your ProTexting username
password
your ProTexting password
keyword keyword to be removed

Option 2 (using key parameter – recommended)

key
your ProTexting Security Key
keyword keyword to be removed

Remove Keyword API call return codes:

* Negative code represent failure to send message

1
The keyword is available
-2
Invalid user or password
-3
Incorrect keyword format: Keyword should contains only letters and digits. Total number of characters must be between 4 and 50
-8
Your IP address is not allowed
-10
The keyword does not exist
-100
Unknown error

Remove Keyword Examples:

Option 1 – EXAMPLE  - (using username and password)

PHP

$ch=curl_init('https://api.protexting.com/deletekeyword.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"user=username&password=password&keyword=mykeyword");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* result of API call*/

?>

Option 2 – EXAMPLE  - (using key parameter – recommended)

 PHP

$ch=curl_init('https://api.protexting.com/deletekeyword.php');

curl_setopt($ch,CURLOPT_POST,1);

curl_setopt$ch,CURLOPT_POSTFIELDS,"key=yourapikey&keyword=mykeyword");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$data = curl_exec($ch);

echo $data;

/* result of API call*/

?>

 

Who can utilize Mobile Marketing?

Media
Radio, TV, Weather, Agencies
Healthcare
Doctors and Dentist offices, Hospitals and Private Practices
Entertainment
Restaurants, Nightclubs, Lounges, Comedy clubs, Theaters, Events
Retail
Shops, Malls, E-commerce, Fairs
Sports
Teams, Arenas, Game, Sport Events
Real Estate
Agents, Builders, Agencies, Management companies
We support all major US carriers:
Sms Api
Sprint
T-Mobile
NEXTEL
AT&T
Virgin Mobile
metroPCS
Are you sure?