DEPRECATED - Developer API: Receive SMS Texts Online

Instantly forward SMS text messages to your application

Choose an API


You can configure any of your Textlocal inboxes to send a notification to a URL whenever you receive a message; this is perfect for two-way communication via your website or application. To enable message notifications, simply enter your URL into the inbox settings within Messenger.

Code Examples

As all we are doing is sending you variables, it's quite difficult to show code examples, however the following might help - including, in some languages, examples of writing the variables to a database and/or file:

			        $inNumber = $_REQUEST["inNumber"];
			        $sender = $_REQUEST["sender"];
			        $keyword = $_REQUEST["keyword"];
			        $content = $_REQUEST["content"];
			        $email = $_REQUEST["email"];
			        $credits = $_REQUEST["credits"];
			        // Example: Writing to a file //
			        // File format: sender, content //
			        $fp = fopen('data.csv', 'a');
			        fwrite($fp, ".$sender.", ".$content."\r\n");
			        // Example: Writing to a database //
			        $mysqlic = new mysqli("localhost", $database_username, $database_password, $database_name);
			        If (mysqli_connect_error()) { die('Connect Error: '.mysqli_connect_errno().' - '.mysqli_connect_error()); };
			        $sql = "INSERT INTO inbound_contact (sender, message) ";
			        $sql .= "'".mysql_real_escape_string($sender)."', ";
			        $sql .= "'".mysql_real_escape_string($content)."')";

API Parameter Details

Once you've configured your Textlocal inbox settings to forward to your URL, the following variables will be sent as POST variables:

sender The sender's mobile phone number in international format. For example, UK numbers will be formatted as 447XXX XXXXXX.
keyword If applicable, the keyword of the inbox.
content The full message content.
comments If applicable, the message without the inbox keyword.
inNumber The inbound number the message was sent to.
email Any email address extracted from the message.
credits The number of SMS credits remaining in your Textlocal account.
Scroll for more