我试图使用Twilio PHP SDK查找电话号码的运营商。 但是,我收到了认证错误。 我不确定我做错了什么。 如果有人能给我建议,我真的很感激! 谢谢。
$lookup_client = new Lookups_Services_Twilio( $this->twilio_sid, $this->twilio_token );
$number = $lookup_client->phone_numbers->get(
'1-416-333-1111',
array(
'Type' => 'carrier',
"CountryCode" => "US",
)
);
echo $number->carrier;
Services_Twilio_TinyHttpException:SSL证书问题,验证CA证书是否正常。详细信息:错误:14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证在第119行的twilio-php \ Services \ Twilio \ TinyHttp.php中失败
答案 0 :(得分:0)
我刚才做了这个。我也在原始输入电话号码的地方做了。希望它有所帮助!
import sys
import os
from twilio.rest.lookups import TwilioLookupsClient
try:
client = TwilioLookupsClient()
phone = raw_input (" Enter The Targets Phone Number: ")
number = client.phone_numbers.get((phone), include_carrier_info=True, )
print(number.carrier['name'])
print(number.carrier['type'])
except:
print ("Error While Handling Phone Number")