Message receipts and configuration

更新时间:
复制 MD 格式

After sending messages using the Chat App Message Service API, you can use the SMQ consumption mode or HTTP batch push mode to receive message delivery status updates and user replies.

Usage notes

Network issues, such as poor connectivity or response timeouts, can cause duplicate message receipts or prevent their retrieval.

Message receipt modes

You can receive message receipts in two modes: SMQ consumption mode and HTTP batch push mode. Choose the mode that best fits your needs.

Important

Message receipts do not guarantee idempotency. You are responsible for handling potential duplicates to ensure data integrity and consistency. We recommend designing your receipt processing logic to be idempotent.

  • SMQ consumption mode

    In SMQ consumption mode, you use an SMQ queue to receive message receipts for a specific region. All business messages support outbound delivery through SMQ. When you enable SMQ and subscribe to a specific message type (MessageType) in the Chat App Message Service console, the system automatically creates a dedicated message queue and generates a queue name (QueueName). You can then use this QueueName and MessageType to call the SDK from your backend and retrieve receipts from the queue.

  • HTTP batch push mode

    In HTTP batch push mode, the system sends data to a specified URL using HTTP POST requests. After you configure a callback URL (callback_url) in the Chat App Message Service console, the system automatically pushes message receipts, such as MO messages and status reports, to that URL.

Message receipt types

After you select a receipt mode, you must subscribe to the message types for the events you want to be notified about. The following message types are available.

Type

Description

SMQ consumption mode

HTTP batch push mode

ChatAppInbound (MO message)

Retrieves messages sent by end users to your business number.

ChatAppInbound

ChatAppInbound

ChatAppStatus (MT message status report)

Tracks the delivery status of outbound messages that you send to end users (MT messages).

ChatAppStatus

ChatAppStatus

ChatAppAudit (template review status)

Receives notifications about the review status of templates created by using the CreateChatappTemplate API.

ChatAppAudit

ChatAppAudit

Configure message receipt modes

Configure status reports and MO messages

To receive message receipts, you must first enable them in the Chat App Message Service console.

  1. Log on to the Chat App Message Service console.

  2. In the left-side navigation pane, click Channel Management. Find your channel and click Manage in the Actions column.

  3. On the channel's Data Panel page, navigate to the webhook settings based on your channel type:

    1. For WhatsApp channels, click WABA Management > Configure Webhook.

    2. For Messenger channels, click Facebook Homepage > Configure Webhook.

    3. For Instagram channels, click Professional Account > Configure Webhook.

  1. Configure your message subscriptions.

    1. After your page, account, or is connected, click Configure Webhook and select the message types you want to subscribe to.

      Note

      Status Report Callback URL: Corresponds to ChatAppStatus (MT message status report).

      MO Message Callback URL: Corresponds to ChatAppInbound (MO message).

      The dialog box also contains the HTTP Protocol and Message Queue Monitoring toggles, and fields for Message Receipt Queue and MO Message Queue. After completing the configuration, click OK.

  2. Enable HTTP Protocol and enter the callback URLs for status reports and MO messages. Example:

    Note

    Best practice: Use distinct URL paths on your server (for example, https://xxxx.com) for each message type to simplify differentiation.

    Not recommended: Avoid routing all message types to a single URL and then parsing the request body to identify the type.




    1. In the Status Report Callback URL field, enter a URL, such as https://xxxx.com/appstatus.

    2. In the MO Message Callback URL field, enter a URL, such as https://xxxx.com/inbound.

  3. Enable Message Queue Monitoring and click OK.

  4. Click Configure Webhook again. In the dialog box that appears, copy the names of the Message Receipt Queue and MO Message Queue.

Configure template review status messages

Note

Currently, only WhatsApp channels support this feature.

  1. Log on to the Chat App Message Service console.

  2. In the left-side navigation pane, click Channel Management. Find your channel and click Manage in the Actions column.

  3. On the channel's Data Panel page, in the left-side navigation pane, click WABA Management > Channel Webhook Settings.

  4. Enable HTTP Protocol and enter the notification callback URL.

    1. In the Notification Callback URL field, enter a URL. For example: https://xxxx.com/appaudit

    2. Enable Message Queue Monitoring and click OK.

    In the Channel Webhook Settings dialog box, enabling Message Queue Monitoring reveals the Notification Queue field, where you can copy the queue name. You can also select an API version as needed.

  5. Click Channel Webhook Settings again. In the dialog box that appears, copy the Notification Queue name.

SMQ SDK download

You can download the SMQ Java SDK to pull messages from your SMQ queue.

SDK Download: SMQ Java SDK