Updated on 2025-11-13 GMT+08:00

Receiving and Processing Reports Sent on Twilio

Function

This interface is invoked to receive and process reports sent on Twilio.

Usage Description

  • Prerequisites

    The WhatsApp channel configuration has been created and the service provider has been set to Twilio.

Interface Authentication

This authentication mode is used for WhatsApp access through the Twilio integrator.

Instructions:

In the AICC, the webhook user and password are configured on the Channel Configuration page.

After the WhatsAppAdapter interface is invoked, the request header generates a signature based on the webhook user and password and adds the signature to the Authorization attribute.

Request Header Parameters

Table 1 Request header parameters

Parameter

Mandatory or Not

Type

Default Value

Description

Content-Type

Yes

String

None

The value is fixed at application/x-www-form-urlencoded.

Authorization

Yes

String

None

Twilio generates Authorization based on the webhook user and password, which is carried in a request sent to the AICC.

Interface Prototype

Table 2 Interface prototype description

Method

POST

URL

https://IP address:Port number/social/on/whatsapp/{whatsAppBsp}/report/{channelConfigId}

IP address:Port number indicates the IP address and port number of the NSLB exposed externally. {whatsAppBsp} indicates the integrator and is fixed at twilio in the twilio provider scenario. {channelConfigId} indicates the channel ID.

Request Body Parameters

Table 3 Request body parameters

Parameter

Mandatory or Not

Type

Description

MessageSid

Yes

String

Message ID identifier.

MessageStatus

Yes

String

Status: delivered or read.

To

Yes

String

Receiver.

From

Yes

String

Sender.

Response Parameters

No response is returned when this interface is invoked.

Example

  • Request
    POST /social/on/whatsapp/twilio/report/****'
    --header 'Authorization: basic ****'
    --header 'Content-Type: application/x-www-form-urlencoded'
    --data-urlencode 'From=whatsapp:+****'
    --data-urlencode 'To=whatsapp:+****'
    --data-urlencode 'MessageStatus=delivered'
    --data-urlencode 'MessageSid=****'