Receiving and Processing MO Messages Sent on Twilio
Function
This interface is invoked to receive and process MO messages 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
|
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
|
Method |
POST |
|
|---|---|---|
|
URL |
https://IP address:Port number/social/on/whatsapp/{whatsAppBsp}/message/{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
|
Parameter |
Mandatory or Not |
Type |
Description |
|---|---|---|---|
|
From |
Yes |
String |
Sender. |
|
To |
Yes |
String |
Receiver. |
|
MessageSid |
Yes |
String |
Message ID identifier. |
|
MessageType |
Yes |
String |
Message types: LOCATION, IMAGE, VEDIO, AUDIO, and TEXT. |
|
MediaContentType0 |
No |
String |
When MessageType is set to IMAGE, VEDIO, or AUDIO, this parameter indicates the multimedia type, for example, image/jpeg and audio/aac. |
|
MediaUrl0 |
No |
String |
When MessageType is set to IMAGE, VEDIO, or AUDIO, this parameter indicates the URL for downloading multimedia files. |
|
Body |
No |
String |
When MessageType is set to TEXT, the value of this parameter is the specific text content. |
|
Address |
No |
String |
When MessageType is set to LOCATION, the value of this parameter is the specific location address. |
|
Label |
No |
String |
When MessageType is set to LOCATION, the value of this parameter is the location name. |
|
ProfileName |
No |
String |
Nickname. |
|
Latitude |
No |
String |
When MessageType is set to LOCATION, the value of this parameter is the location latitude. |
|
Longitude |
No |
String |
When MessageType is set to LOCATION, the value of this parameter is the location longitude. |
|
OriginalRepliedMessageSid |
No |
String |
When a message is referenced, the value of this parameter is the ID identifier of the referenced message. |
|
OriginalRepliedMessageSender |
No |
String |
When a message is referenced, the value of this parameter is the sender of the referenced message. |
Response Parameters
No response is returned when this interface is invoked.
Example
- Request
POST /social/on/whatsapp/twilio/message/**** --header 'Authorization: basic ****' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'ProfileName=****' --data-urlencode 'From=whatsapp:****' --data-urlencode 'To=whatsapp:****' --data-urlencode 'MessageType=****' --data-urlencode 'MessageSid=****' --data-urlencode 'Body=****'
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot