Skip to content

Instantly share code, notes, and snippets.

@twilioforkwc
Created September 12, 2015 02:56
Show Gist options
  • Save twilioforkwc/9c275cf596b6bc0cc081 to your computer and use it in GitHub Desktop.
Save twilioforkwc/9c275cf596b6bc0cc081 to your computer and use it in GitHub Desktop.
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACxxxxxxxxxxxx";
$token = "{{ auth_token }}";
$client = new Services_Twilio($sid, $token);
// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$number = $client->account->incoming_phone_numbers->get("PNxxxxxxxxxxxxxxxx");
$number->update(array(
"VoiceUrl" => "http://demo.twilio.com/docs/voice.xml",
"SmsUrl" => "http://demo.twilio.com/docs/sms.xml"
));
echo $number->voice_url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment