简体   繁体   English

Twilio“找不到带有 sid 的地址...以满足本地地址要求”

[英]Twilio "Could not find Address with sid ... to satisfy Local Address requirement"

I'm trying to use the Twilio API to buy a phone number with a "Local" address requirement on behalf of a customer using the "Connect" API.我正在尝试使用 Twilio API 代表使用“连接”API 的客户购买具有“本地”地址要求的电话号码。

The purchase request looks like this:购买请求如下所示:

$twilio = new \Twilio\Rest\Client($customerConnectedSid, env('TWILIO_AUTH_TOKEN'));

$numberRes = $twilio->incomingPhoneNumbers->create([
    'phoneNumber' => $numberString,
    'addressSid' => $user->company->twilio_address_sid,
]);

The error I get back from Twilio is:我从 Twilio 得到的错误是:

[HTTP 400] Unable to create record: Could not find Address with sid AD*** for account AC*** to satisfy Local Address requirement [HTTP 400] 无法创建记录:无法为帐户 AC*** 找到带有 sid AD*** 的地址以满足本地地址要求

I don't know why it can't "find" that address because both the accountSid and sid match in the response from:我不知道为什么它不能“找到”那个地址,因为accountSidsid在来自以下的响应中都匹配:

$twilio->addresses->read([], 100)

So clearly the address exists.很明显,地址存在。

I think I just figured it out, but I'm going to leave the question up anyway in case someone else encounters it.我想我只是想通了,但无论如何我都会留下这个问题,以防其他人遇到它。

The error message is just bad.错误消息很糟糕。

It can "find" the address, but it doesn't satisfy the local address requirement.可以“找到”地址,但不满足本地地址要求。

Make sure the address is actually for the region where the phone number is.确保地址实际上是电话号码所在的地区。

I'm having the same problem.我有同样的问题。 How do I deal with it?我该如何处理? I create a new address in the same region as the number I'm trying to buy.我在与我要购买的号码相同的地区创建了一个新地址。 got the same error得到同样的错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM