Message Event
Message event is an object provided by the platforms which contains the information about the message, which can be access by this.messageEvent.
Example
this.messageEvent.data.text
// => "TEXT"
| Property | Type | Description |
|---|---|---|
| data | object | Message data |
| from | string | PSID of the user |
| messageId | string | Optional Message ID |
| origin | string | Optional Message origin. Values include: CUSTOMER_CHAT_PLUGIN, and MESSENGER |
| timestamp | string | Unique identifier for this specific action occurrence generated |
| to | string | Page ID |
data object
| Property | Type | Description |
|---|---|---|
| accountLinking | object | ACCOUNT_LINKING. Information about the link account or unlink account are clicked |
| app_id | string | ECHO TYPE ONLY. ID of the app from which the message was sent |
| appRoles | object | APP_ROLES TYPE ONLY. Contains Page ID |
| attachments | array<object> | Available only when there is an attachment |
| delivery | object | DELIVERY TYPE ONLY. Information about delivered message of a Facebook page |
| metadata | string | ECHO TYPE ONLY. Custom string |
| passThreadControl | object | PASS_THREAD_CONTROL TYPE ONLY. Information about passing the control of one conversation from one app to another |
| payload | string | PAYLOAD TYPE ONLY. Custom data provided by the app |
| policyEnforcement | object | POLICY_ENFORCEMENT TYPE ONLY. Information about policy enforcement |
| referral | object | PAYLOAD AND REFERRAL TYPE ONLY. Referral information. |
| requestThreadControl | object | REQUEST_THREAD_CONTROL TYPE ONLY. Information about requesting control of one conversation of one app |
| read | object | READ TYPE ONLY. Information about read message of a Facebook page |
| takeThreadControl | object | TAKE_THREAD_CONTROL ONLY. Information about taking control of one conversation from a secondary app |
| text | string | TEXT TYPE ONLY. Message text |
| title | string | Title of the call-to-action button |
| type | string | Message type. Values include TEXT, PAYLOAD, REFERRAL, DELIVERY, ECHO, READ, OPTIN, ACCOUNT_LINKING, PASS_THREAD_CONTROL, REQUEST_THREAD_CONTROL, TAKE_THREAD_CONTROL, APP_ROLES, POLICY_ENFORCEMENT, and MISC. |
For further reference of type TEXT, PAYLOAD, REFERRAL, DELIVERY, ECHO, READ, OPTIN, ACCOUNT_LINKING, POLICY_ENFORCEMENT and MISC, please see the Facebook documentation.
For further reference of type PASS_THREAD_CONTROL, REQUEST_THREAD_CONTROL, TAKE_THREAD_CONTROL, APP_ROLES, please see the Facebook documentation.
attachment object
| Property | Type | Description |
|---|---|---|
| type | string | Attachment type. Values include IMAGE, VIDEO, AUDIO, LOCATION, FILE, FALLBACK, and TEMPLATE |
| url | string | Attachment URL. Available only on IMAGE, VIDEO, AUDIO, and FILE type. |
Slack
In Slack, there are 3 different webhook events and will compose different messageEvent objects.
Slash command webhook
| Property | Type | Description |
|---|---|---|
| data | object | Message content |
| from | string | Sender ID |
| response_url | string | URL can be used to post responses to dialog submissions |
| teamId | string | Slack team ID |
| timestamp | string | Unique identifier for this specific action occurrence generated |
| to | Slack channel ID | |
| type | string | Slack event type |
data object
| Property | Type | Description |
|---|---|---|
| payload | string | Slash event command |
| text | string | Message text content |
Action webhook
| Property | Type | Description |
|---|---|---|
| data | object | Message content |
| from | string | Sender ID |
| response_url | string | URL can be used to post responses to dialog submissions |
| teamId | string | Slack team ID |
| timestamp | string | Unique identifier for this specific action occurrence generated |
| to | Slack channel ID | |
| type | string | Slack event type |
data object
| Property | Type | Description |
|---|---|---|
| callback_id | string | An identifier strictly for you to recognize submissions of this conversation |
| originalMessage | string | Message text content |
| payload | string | If there is a JSON value of in the first action, it is a Javascript object. Otherwise, it will return the original value. |
| trigger_id | string | Short-lived pointer, which expired in 3 seconds, to interaction's who, what, where, and when |
Event webhook
| Property | Type | Description |
|---|---|---|
| bot_id | string | Optional Slack bot ID |
| data | object | Message content |
| event | object | Message event in a more detailed manner |
| from | string | (bot_id AND isBot) Slack bot ID (default) sender ID |
| isBot | boolean | Optional Status of whether the conversation is conducted by bot |
| teamId | string | Slack team ID |
| timestamp | string | Unique identifier for this specific action occurrence generated |
| to | string | Slack channel ID |
| type | string | Message type. Values include: TEXT, MISC, IMAGE |
data object
| Property | Type | Description |
|---|---|---|
| attachments | object | Attachment information inside data |
| text | string | Message text content |
attachments object
| Property | Type | Description |
|---|---|---|
| downloadUrl | string | Download URL of the file |
| type | string | Attachment type. Values include: IMAGE, VIDEO, FILE, and TEXT |
event object
| Property | Type | Description |
|---|---|---|
| subtype | string | Message subtype. Values include bot_message and file_share |
Teamwork
Coming soon...
| Property | Type | Description |
|---|---|---|
| data | object | Message data |
| from | string | Whatsapp ID of the sender of the original message |
| mentions | array<string> | List of mentioned IDs |
| timestamp | string | Message received timestamp |
| to | string | Whatsapp ID of the receiver of the original message |
| type | string | Message type. Values include: TEXT, MISC, and SYSTEM |
data object
| Property | Type | Description |
|---|---|---|
| attachments | array<object> | Message attachments. This field will not be available when the type of the message is TEXT or SYSTEM |
| system | object | System message information. Please see the Facebook documentation for further reference |
| text | string | Message text content. This field is available only the message type is TEXT |
attachements object
| Property | Type | Description |
|---|---|---|
| caption | string | Caption of the attachment |
| opus | boolean | Audio format. Available only for the 1st item in the attachments array |
| type | string | Attachment type. Values include: IMAGE, VIDEO, AUDIO, and FILE |
| waMediaId | string | Whatsapp media ID |
Coming soon...
