有没有办法使用 Twilio python lookup api 打印输出并将找到的调用者姓名用作变量?

Is there a way to use Twilio python lookup api print output and use the caller name found as variable?

我正在使用 twilio api 通过 python 进行查找。我如何使用 twilio 返回的来电者姓名作为变量来更新数据库中的 phone number owner name 字段或者是否有任何其他方法可以实现它?

我尝试使用 'stdout' 创建 print(phone_number.caller_name)

的实例

twilio 查找代码

phone_number = client.lookups.phone_numbers('+1(000) 000-0001').fetch(type='caller-name')

print(phone_number.caller_name)

这里是 Twilio 开发人员布道者。

我会制作一个字典来将对应于 caller_name 键的值保存为一个变量,如下所示:

name_dict = phone_number.caller_name print(name_dict['caller_name'])