How To Retrieve Two-Way SMS Messages From Clickatell Gateway
In an earlier post, I wrote about what a two-way (2-way) or bidirectional messaging is and the sms messaging provider to consider if you are considering building a 2-way sms application.
This tutorial shows you how to retrieve your two-way messages from Clickatell’s Gateway using their HTTP/S Protocol. It is fairly simple and almost the same as using a Callback URL to retrieve SMS Message response from Clickatell gateway.
Before using this tutorial, make sure two things are done
1. REQUEST for your Clickatell two-way number.
2. Set the callback URL at your control panel on Clickatell’s website. eg. (www.mboateng.com/2way/callback.php)
Once these two things have been done, you will need to create a mysql table which will store data sent to your web server by Clickatell’s Gateway API. Below is the mysql script.
Mysql Table (tbl_messages)
CREATE TABLE ‘tbl_messages’ (
‘msgid’ int(10) NOT NULL auto_increment,
’sender’ varchar(50) default NULL,
‘recipient’ varchar(50) default NULL,
‘dated’ varchar(50) default NULL,
‘message’ text,
PRIMARY KEY (’msgid’)
) ENGINE=MyISAM;
//The sender field stores the number/ name of the sender
//The recipient of course will be your Clickatell assigned number
//The Dated field will store the timestamp of the sms message
// The Message fields stores the SMS Message















