メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Twilio Verify Feedback API

The Verify API is intended for customers using your own One-Time Password or Custom Code. Contact Twilio Sales and we'll help you enable this feature.

If you're not using custom code, the Feedback functionality is already provided by the standard workflow of the Verify API.

Twilio Verify, when used with our code generation and validation, uses Twilio's route intelligence engine to optimize SMS and Voice deliverability. This means that we will automatically retry with different routes if users request multiple verification codes without validating codes or if we notice performance is worse than our baseline. Customers who use pin verification through the Verify API get these benefits of deliverability tuning and monitoring feedback of Twilio's system.

When customers use our custom_code feature to send and validate their own codes, we don't get the same transparency. In order to achieve insights into possible deliverability issues, we built a proxy to the Twilio Feedback API that customers can use to send us this data. This allows us to optimize routing and ensure that your verification codes are sent as quickly and reliably as possible.

By using the Feedback API, we'll be able to proactively address potential issues caused by interruptions in telecom routes that affect deliverability. This API will help ensure your user gets a verification code regardless of the telecom infrastructure circumstances.

Send Message Feedback

This call will report the status of a message.

POST https://api.authy.com/2010-04-01/Accounts/Messages/SMS/Messages/{SMSMessageSid}/Feedback

URL

名前 Type 概要
ApiKey 文字列 The API Key for your Verify Application.
SMSMessageSid 文字列 The sms_id found in the response of a phone verification start.

パラメーター

名前 Type 概要
結果 文字列(オプション) received if the customer correctly entered the code provided in the message or not-received if the customer took no action within 2 minutes. (🏢 not PII )

サンプル

Custom Code Feedback

Start by sending a verification code to a user’s phone number.

curl 'https://api.authy.com/protected/json/phones/verification/start' \
-H "X-Authy-API-Key: d57d919d11e6b221c9bf6f7c882028f9" \
-d via='sms' \
-d phone_number='111-111-1111' \
-d country_code=1 \
-d locale='en' \
-d custom_code=12345

サンプルレスポンス:

{
  "carrier": "AT&T Wireless",
  "is_cellphone": true,
  "message": "Text message sent to +1 111-111-1111.",
  "seconds_to_expire": 599,
  "uuid": "caf8eb00-6d03-1234-5678-0eb34144aeb2",
  "sms_id": "cafd7a60-6d03-1234-5678-0eb34144aeb2", # You'll use this ID to send feedback
  "success": true
}

This will send an SMS to the user.

If the user correctly enters the code in your application send the following:

curl -XPOST 'https://api.authy.com/2010-04-01/Accounts/d57d919d11e6b221c9bf6f7c882028f9/SMS/Messages/cafd7a60-6d03-1234-5678-0eb34144aeb2/Feedback.json' \
-d Outcome='received'

If the user takes no action within 2 minutes send the following:

curl -XPOST 'https://api.authy.com/2010-04-01/Accounts/d57d919d11e6b221c9bf6f7c882028f9/SMS/Messages/cafd7a60-6d03-1234-5678-0eb34144aeb2/Feedback.json' \
-d Outcome='not-received'

レスポンス

{
  "account_sid": "",
  "message_sid": "cafd7a60-6d03-1234-5678-0eb34144aeb2",
  "outcome": "received",
  "date_created": "Wed, 18 Jul 2018 21:59:40 +0000",
  "date_updated": "Wed, 18 Jul 2018 22:02:29 +0000",
  "uri": "",
  "success": true
}

Your account_sid and uri will be empty in this response.

Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。