SMS authentication receipt message

Updated at:

After you send SMS verification codes using the SMS Authentication Service API operation, you can configure the Message Service (MNS) consumer pattern or the HTTP batch push pattern to receive status reports.

Introduction to receipt messages

There are two patterns for receiving receipt messages: the Message Service (MNS) consumer pattern and the HTTP batch push pattern. Choose the pattern that suits your needs.

Message Service (MNS) consumer pattern

The Message Service (MNS) consumer pattern uses a queue model to receive receipt messages for SMS verification codes in a specified region. Message Service can send all business messages from Alibaba Cloud Communications. When you enable Message Service in the Phone Number Verification Service console and subscribe to a specific message type (MessageType), the system automatically creates a separate message queue and queue name (QueueName) for that type. You can then use this queue name (QueueName) and message type (MessageType) to retrieve SMS status reports from the queue by making SDK calls from your backend.

HTTP batch push pattern

The HTTP batch push pattern sends messages to a specified web URL using HTTP POST requests. After you set an HTTP callback URL (callback_url) in the Phone Number Verification Service console, the system pushes business messages, such as SMS status reports, to that URL when they are generated. You can receive these messages directly at the URL.

Receipt message types

Name

Description

Message Service (MNS) consumer pattern

HTTP batch push pattern

DypnsSmsVerifyReport (Receive SMS verification send status reports)

After enabling DypnsSmsVerifyReport receipts, you can receive status reports for SMS verification codes that you send by calling the SendSmsVerifyCode operation.

DypnsSmsVerifyReport

DypnsSmsVerifyReport

Configure receipt messages

Note
  • Due to system caching, messages are not pushed immediately after you enable receipts. Please wait 15 minutes for the setting to take effect.

  • Network issues, such as abnormalities or response timeouts, can cause duplicate message pushes or failures to retrieve receipt messages. If you fail to retrieve a receipt message, check your network connection and retry later.

  • Receipt messages do not guarantee idempotence. If your processing logic requires idempotence, you must implement it based on your scenario.

Configuration steps

  1. Log on to the Phone Number Verification Service console.

  2. In the navigation pane on the left, choose SMS Authentication Service > SMS Authentication Parameter Settings. On the Status Report Receiving tab, enable the desired pattern.

    Message Service (MNS) consumer pattern

    1. Enable the Message Service (MNS) consumer pattern.

    2. Select a region.

      The region must be the same as the one you select when you call the API operation.

    3. Click OK. The configuration is complete.

    HTTP batch push pattern

    Note

    The response timeout period for the HTTP batch push pattern is 700 ms.

    1. Turn on the switch for HTTP Batch Push Mode.

    2. Enter the URL to receive receipt messages.

      Note

      Before you enter the receiving URL, you can click Test and provide a test URL to verify that it can receive receipt messages. Your server-side URL must return a response that strictly follows the JSON format specified in the response information.

      Example: http://push.example.com/contextpath/receive.do.

    3. Click OK. The configuration is complete.

References

Message Service (MNS) consumer demo