如何从 Twilio SMS 的状态回调中获取错误描述?

How to get error description from status callback from Twilio SMS?

sent/delivered 状态的情况下,Twilio 使用以下参数 POSTing 到请求的 webhook url:SmsSid, SmsStatus, MessageStatus, To, MessageSid, AccountSid, From, ApiVersion)

我无法使用试用帐户模拟 failed/undelivered 状态。

文档 here 说:

Twilio will POST the MessageSid along with the other standard request parameters as well as MessageStatus and ErrorCode.

我的问题来自 ErrorCode(数字)你如何获得 "ErrorMessage"/"ErrorDescription",这是人类可读的东西。

如果 failed/undelivered 状态,Twilio 是否会在任何参数中传递它? 我发现文档说:

If your message status is failed or undelivered, the ErrorCode can give you more information about the failure.

但是怎么办?以 Twilio 传递给我们的 webhook url 的任何其他额外参数的形式。如果是,它们的参数名称是什么?或者使用 ErrorCode? 进行新的 api 调用。你是怎么做到的?

此处为 Twilio 开发人员布道师。

error reference in the Twilio docs.

中提供了人类可读的错误描述

邮件传递错误如下:

30001: Message Delivery - Queue overflow

30002: Message Delivery - Account suspended

30003: Message Delivery - Unreachable destination handset

30004: Message Delivery - Message blocked

30005: Message Delivery - Unknown destination handset

30006: Message Delivery - Landline or unreachable carrier

30007: Message Delivery - Carrier violation

30008: Message Delivery - Unknown error

希望对您有所帮助!