<?php // Get the PHP helper library from twilio.com/docs/php/install require_once '/path/to/vendor/autoload.php'; // Loads the library use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/user/account $sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $token = "your_auth_token"; $client = new Client($sid, $token); $client->messages("MM5ef8732a3c49700934481addd5ce1659")->delete(); // Deletes entire message record
<?php // Get the PHP helper library from twilio.com/docs/php/install require_once '/path/to/vendor/autoload.php'; // Loads the library use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/user/account $sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $token = "your_auth_token"; $client = new Client($sid, $token); // Get an object from its sid. If you do not have a sid, // check out the list resource examples on this page $message = $client->messages("MM800f449d0399ed014aae2bcc0cc2f2ec")->fetch(); echo $message->body;
<?php // Get the PHP helper library from twilio.com/docs/php/install require_once '/path/to/vendor/autoload.php'; // Loads the library // Use the REST API Client to make requests to the Twilio REST API use Twilio\Rest\Client; $uniqueId = $_REQUEST['id']; // Lookup variable `$uniqueId` in a database to find messageSid $messageSid = 'SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // Your Account SID and Auth Token from twilio.com/console $accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $authToken = 'your_auth_token'; $client = new Client($accountSid, $authToken); $client->messages($messageSid)->feedback->create(array("outcome" => "confirmed")); echo 'Thank you!';
<?php // Get the PHP helper library from twilio.com/docs/php/install require_once '/path/to/vendor/autoload.php'; // Loads the library use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/user/account $sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $token = "your_auth_token"; $client = new Client($sid, $token); $client->messages("MM800f449d0399ed014aae2bcc0cc2f2ec")->media("ME557ce644e5ab84fa21cc21112e22c485")->delete();
<?php // Get the PHP helper library from twilio.com/docs/php/install require_once '/path/to/vendor/autoload.php'; // Loads the library use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/user/account $sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $token = "your_auth_token"; $client = new Client($sid, $token); $allMedia = $client->messages("MM800f449d0399ed014aae2bcc0cc2f2ec")->media->read(); // Loop over the list of media and echo a property for each one foreach ($allMedia as $media) { echo $media->contentType; }