I am using - PHP Library of Twilio and want to grab all messages sent & received to a specific number?
I am new to this. Can any one guide/help me?
Twilio developer evangelist here.
You want to use the Messages list resource (you're right, the SMS resource is deprecated). You can pass in filters for the To and From attributes in order to get all the messages to that number.
Let me know if that helps.
i figured out a easy way to grab all messages of a specific number using CURL
$base_url = "https://api.twilio.com/2010-04-01/Accounts/SID/Messages?From=1112223333";
$ch = curl_init($base_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$account_sid:$auth_token");
$response = curl_exec($ch);
curl_close($ch);
$xml_array = new SimpleXMLElement($response);
echo "<pre>"; print_r($xml_array); echo "</pre>";
Its 100% working example and you can get working all other functions by reading their updated docs at https://www.twilio.com/docs/api/rest/message