php - Twilio lookup API not working? -


i'm trying use twilio's lookup api properties of mobile number via php... little success:

    $twilioclient = new lookups_services_twilio(credential::twiliosid, credential::twiliotoken);     $number = $twilioclient->phone_numbers->get($somenumber); 

note example code present within 'getting started' page here.

by taking @ $number in debugger, can confirm returning something:

enter image description here

the highlighted property of object recursive no new information.

attempting evaluate $number->phone_number returns null. have tried perhaps half dozen valid numbers , response get.

attempting json_encode($number) returns false.

i have no idea why not working, it'd helpful if know i'm doing wrong.

i'm gonna go ahead , assume phone numbers you've tried neither us, nor in international format.

from twilio's lookups quickstart tutorial:

you'll want include country code of phone number formatted. if not included, country code default us.

so lookup should like:

$number = $twilioclient->phone_numbers->get($somenumber, array('countrycode' => 'nz')); 

if phone numbers are us, in international format, or if above still not work, try whether lookup succeeds on twilio's web interface (you'll need international prefix there).

if does, software library might broken or twilio account might have incorrect/broken access rights.

if web lookup fails well, should contact twilio , report issue.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -