Created
June 8, 2011 21:46
-
-
Save andrewwatson/1015496 to your computer and use it in GitHub Desktop.
Upgrade Phone Number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sn = $argv[1]; | |
$asid = $argv[2]; | |
$sid = "ACxxxxx"; | |
$token = "xxxxx"; | |
$url = "https://api.twilio.com/2010-04-01/Accounts/${asid}/IncomingPhoneNumbers/${sn}"; | |
printf("%s\n",$url); | |
$vars = "ApiVersion=2010-04-01"; | |
$ch = curl_init($url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); | |
curl_setopt($ch,CURLOPT_USERPWD, "$sid:$token"); | |
curl_setopt($ch,CURLOPT_POST, true); | |
curl_setopt($ch,CURLOPT_POSTFIELDS,$vars); | |
$result = curl_exec($ch); | |
$info = curl_getinfo($ch); | |
$xml = simplexml_load_string($result); | |
//var_dump($result); | |
printf("%s\n",$info['http_code']); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment