0

I want when someone message me on my clickatell number then I want to send this message on my email. I'm using the http request.I have check the http api pdf in which only showing the authentication and send message url . I want the url by whcih I get the message in my script.

I'm using the curl function for request the page.

    $curl = curl_init();
     // Set some options - we are passing in a useragent too here
  curl_setopt_array($curl, array(
 CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://api.clickatell.com/http/auth?user=demo& 
  password=demo&api_id=123432',
CURLOPT_USERAGENT => 'Codular Sample cURL Request',
   CURLOPT_POST => 1,
 CURLOPT_POSTFIELDS => array(
    item1 => 'value',
    item2 => 'value2'
)
));
 // Send the request & save response to $resp
   $resp = curl_exec($curl);
 print_r($resp);
  // Close request to clear up some resources
   curl_close($curl);

It is working and return me the session id and ok status. similarly can I get the incoming message ?

user1734190
  • 157
  • 1
  • 2
  • 12

1 Answers1

2

Clickatell has a two-way service which will allow you to receive messages from their service and their implementation documentation can be read here.

In order to receive the notice via email, I would recommend opting for the HTTP callback from Clickatell's servers. This will allow you to write a small script to convert the contents into an email.

Hope that this helps you.

j_freyre
  • 4,623
  • 2
  • 30
  • 47