Twilio Lookup API 用于过滤掉 phone 个数字

Twilio Lookup API for filtering out phone numbers

我有一个应用程序允许用户向他们在帐户中上传的号码发送短信。我开始实施 Twilio Lookup API 以避免向无法接收短信的号码发送短信。 运行 运营商查找并根据返回的 type 信息过滤掉固定电话很容易,但我想知道我是否可以从返回的查找信息中收集到任何其他信息,这些信息将指示一个数字不接受短信。

通常 Twilio 文档非常详尽,但我觉得缺少这些信息。感谢您提供任何信息,所有 Twilio 传播者!

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

查找 API 在很大程度上取决于我们可以访问的基础数据源。

我对您问题的最佳回答是:

Does a blank mobile_network_code signify anything?

底层数据无法提供移动网络代码。如果 phone 号码在类型中仍然显示为手机号码,那么您应该仍然可以向它发送短信。例如,carrier data for Canadian numbers 存在问题,导致我们无法提供此数据。

  • 有什么方法可以判断一个 VoIP 号码是否收不到短信?

不,在这种情况下最好的办法是尝试发送消息并捕获并记录任何错误。

  • type = null 是否告诉我有关 phone 数字的任何有用信息?

不是真的,您应该再次尝试发送消息并处理错误。有关更多信息,请参阅 Canadian carrier data 上的注释。

  • 是否有任何特定的 error_code 值表示该号码无法接收短信?

有多个error codes that relate to Lookup queries in the 6xxxx range. 60600 and 60610 mean similar things, that the phone is unprovisioned or out of coverage and that you likely can't send it a message. 60612 means it's not a mobile number, but should only be returned for lookup providers that require the number being looked up to be a mobile, which doesn't apply for the type information. Other error_codes tend to be about your account's ability to use a provider or package for looking numbers up. You can peruse the catalogue of errors for more information