Use Simple Message Queue (formerly MNS) to receive Mobile Originated (MO) messages.
Prerequisites
You have registered an Alibaba Cloud account and created an AccessKey pair. For more information, see Create an AccessKey pair.
You have reviewed the overview and configuration of message receipts and understand their modes, types, and configuration process. Then, configure the message receipts accordingly.
Message body format
Parameter | Type | Required | Description |
MessageId | String | Yes | A unique identifier for the message. |
CustSpaceId | String | Yes | The channel ID. |
WabaId | String | Yes | The ID of the WhatsApp Business Account (WABA). |
From | String | Yes | The sender's phone number. |
To | String | Yes | The recipient's phone number. |
Timestamp | Long | Yes | The Unix timestamp when the message was sent, in milliseconds. |
DisplayName | String | Yes | The sender's display name. |
Type | String | Yes | The type of the message. Valid values:
|
Message | Object | Yes | The content of the message.
|
Name | String | Yes | The name of the user. |
LOCATION object
Parameter | Type | Required | Description |
address | String | Yes | The address information. |
latitude | String | Yes | The latitude. |
longitude | String | Yes | The longitude. |
name | String | Yes | A location description. |
VIDEO object
Parameter | Type | Required | Description |
name | String | Yes | A description of the video file. |
id | String | Yes | The ID of the video file. |
mimeType | String | Yes | Fixed value: Note This parameter can be ignored if |
url | String | Yes | The URL of the video file. Note The URL is valid for 7 days. |
IMAGE object
Parameter | Type | Required | Description |
caption | String | No | A description of the image. |
id | String | Yes | The ID of the image. |
mimeType | String | Yes | The MIME type of the image. |
url | String | Yes | The URL of the image. Note The URL is valid for 7 days. |
AUDIO object
Parameter | Type | Required | Description |
name | String | Yes | A description of the audio file. |
id | String | Yes | The ID of the audio file. |
mimeType | String | Yes | Fixed value: Note This parameter can be ignored if |
url | String | Yes | The URL of the audio file. Note The URL is valid for 7 days. |
DOCUMENT object
Parameter | Type | Required | Description |
name | String | Yes | A description of the document. |
id | String | Yes | The ID of the document. |
filename | String | Yes | The file name of the document. |
mimeType | String | Yes | Fixed value: |
url | String | Yes | The URL of the document. Note The URL is valid for 7 days. |
REPLY object
Parameter | Type | Required | Description |
text | String | Yes | The text label of the button that the user clicked. |
payload | String | Yes | The payload returned when the user clicks the button. This value matches the payload you defined in the sent message. |
SYSTEM object
Parameter | Type | Required | Description |
body | String | Yes | Describes a change in the user's identity or phone number. |
wa_id | String | Yes | The user's new WhatsApp ID after their phone number is updated. |
type | String | Yes | The type of system update. Valid values:
|