I'm trying to use Twilio's Lookup API to get certain properties of a mobile number via PHP... with very little success:
$twilioClient = new Lookups_Services_Twilio(Credential::TwilioSID, Credential::TwilioToken);
$number = $twilioClient->phone_numbers->get($someNumber);
Note that this is the example code present within their 'Getting Started' page here.
By taking a look at $number
in the debugger, I can confirm it is returning something:
The highlighted property of the object is simply recursive with no new information.
Attempting to evaluate $number->phone_number
returns null
. I have tried this with perhaps half a dozen completely valid numbers now and this is the only response I get.
Attempting to json_encode($number)
returns false
.
I have no idea why this is not working, but it'd be helpful if I could know what I'm doing wrong.