Other
User shares location
{
"app": "DemoApp",
"timestamp": 1580228767338,
"version": 2,
"type": "message",
"payload": {
"id": "ABEGkYaYVSEEAhCIxTq7KXQIqby1Uo-IO7_E",
"source": "918x98xx21x4",
"type": "location",
"payload": {
"longitude": "72.8552172",
"latitude": "19.1453658"
},
"sender": {
"phone": "918x98xx21x4",
"name": "Smit",
"country_code": "91",
"dial_code": "8x98xx21x4"
}
}
}
Payload object description
Key | Description | Example |
---|---|---|
longitude | The longitude of the location | 72.8552172 |
latitude | The latitude of the location | 19.1453658 |
The user shares a contact card
{
"app": "DemoApp",
"timestamp": 1584898884710,
"version": 2,
"type": "message",
"payload": {
"id": "ABEGkYaYVSEEAhD9cTZVyPlOGYZJOnviI7OJ",
"source": "918x98xx21x4",
"type": "contact",
"payload": {
"contacts": [
{
"addresses": [
{
"city": "Menlo Park",
"country": "United States",
"countryCode": "us",
"state": "CA",
"street": "1 Hacker Way",
"type": "HOME",
"zip": "94025"
},
{
"city": "Menlo Park",
"country": "United States",
"countryCode": "us",
"state": "CA",
"street": "200 Jefferson Dr",
"type": "WORK",
"zip": "94025"
}
],
"emails": [
{
"email": "[email protected]",
"type": "WORK"
},
{
"email": "[email protected]",
"type": "WORK"
}
],
"ims": [
],
"name": {
"first_name": "Dev",
"formatted_name": "Dev Support",
"last_name": "Support"
},
"org": {
"company": "Dev Support"
},
"phones": [
{
"phone": "+91 77383 05433",
"type": "Mobile"
}
],
"urls": [
{
"url": "https://www.facebook.com",
"type": "WORK"
}
]
}
]
},
"sender": {
"phone": "918x98xx21x4",
"name": "Smit",
"country_code": "91",
"dial_code": "8x98xx21x4"
}
}
}
Payload object description
Key | Type | Description | Example |
---|---|---|---|
addresses | array | Full contact address(es). This field can contain street , city , state , zip , country , country_code , and type fields. | { "city": "Menlo Park", "country": "United States", "countryCode": "us", "state": "CA", "street": "1 Hacker Way", "type": "HOME", "zip": "94025" } |
email | array | Contact email address(es). This field can contain the email and type fields. | { "email": "[email protected]", "type": "WORK" } |
birthday | YYYY-MM-DD formatted string | Contacts birthday | 1995-10-06 |
ims | array | Messaging contact information. This field contains the service and user_id fields. | |
name | array | Full contact name. This field can contain the first_name , middle_name , last_name , formatted_name , name-prefix , and name_suffix fields. | {"first_name":"Dev","formatte name": "Dev Support","last_name": "Support"} |
org | array | Contact organization information. This field can contain the company , department , and title fields. | {"company":"Dev Support"} |
phones | array | Contact phone number(s). This field can contain the phone , wa_id , and type fields. | [{"phone":"+917738305433","type":"Mobile"}] |
urls | array | Contact URL(s). This field can contain the url and type fields. | [{"url":"https://www.facebook.com", "type": "WORK" }] |
Referral
This event occurs when a user clicks on an Ad that takes them to the WhatsApp application to send a message to your business. The inbound event includes the ad's information.
{
"app": "DemoApp",
"timestamp": 1624350395531,
"version": 2,
"type": "message",
"payload": {
"id": "ABEGkZlpNARoAgo6v1b-zBR7EnX3",
"source": "918x98xx21x4",
"type": "text",
"payload": {
"text": "I saw this on Facebook..."
},
"sender": {
"phone": "918x98xx21x4",
"name": "Smit",
"country_code": "91",
"dial_code": "8x98xx21x4"
},
"referral": {
"body": "Test post payload",
"headline": "Demo Gupshup ad",
"image": {
"id": "6a35b528-429d-4fe3-953d-536ef0397ece"
},
"source_id": "951242428775548",
"source_type": "post",
"source_url": "https://fb.me/2oNXGTsjn"
}
}
}
Payload object description
Key | Description | Example |
---|---|---|
headline | The headline of the Ad | Demo Gupshup Ad |
body | The body of the Ad | Test post payload |
source_type | The Ad's source type. Supported values are ad and post . | post |
source_id | It is the Facebook ID for an Ad or a post | 951242428775548 |
source_url | The URL of the Ad | https://fb.me/2oNXGTsjn |
image or video | Optional The Ad's image or video ID. | { "id": "6a35b528-429d-4fe3-953d-536ef0397ece" } |
Inbound Reactions
End-users on WhatsApp can react to the business's message with an emoji. The payload is sent to the business as an inbound message. This feature is currently available only for CAPI users i.e. users who have WhatsApp docker hosted in Meta Cloud
"body": {
"app": "sumitqacloudapp",
"timestamp": 1693819859221,
"version": 2,
"type": "message",
"payload": {
"id": "wamid.HBgMOTE4MzI5NzUwODAwFQIAEhggMkI4QkY5QjIyOEE4RTE3NDc4M0FBRkIxREY5NTY5N0UA",
"source": "918329750800",
"type": "reaction",
"payload": {
"id": "9340ac2e-efe7-4836-b379-65a92b281375",
"gsId": "d8b6b10a-f61e-4ff5-910a-a1ac34b439ef",
"emoji": "❤️"
},
"sender": {
"phone": "918329750800",
"name": "~me",
"country_code": "91",
"dial_code": "8329750800"
}
}
}
Payload description
Key | Description |
---|---|
id | WhatsApp msg ID |
emoji | Emoji user reacted with |
gsID | Gupshup message ID |
Updated 3 months ago
What’s Next
In the next chapter of this guide, you'll learn about inbound events and their types.