<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/whatsapp-api/webhook/incoming-messages

# Incoming Messages

**Webhook.** Sent to the webhook URL you configure.

With every incoming message, you will receive the following webhook
(`hook` "new").

**Settings:**

| Setting | Value |
| --- | --- |
| URL | Your URL — set it with [Set Webhook](https://docs.99digital.co.il/whatsapp-api/webhook/set-webhook) |
| Method | JSON via POST |

Incoming messages webhooks are always sent once a webhook URL is set. How
webhooks are delivered and retried, and the IP address they come from, is
explained on [Webhook](https://docs.99digital.co.il/whatsapp-api/webhook/webhook).

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": "IL.1605856887361213",
  "username": null,
  "country": "IL",
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "text",
  "body": "Hi, is the store open today?",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1435,
  "isNewConversation": 1,
  "referral": {
    "ref_type": "none"
  }
}
```

:::warning
You must download the link files to your server. We delete all files within
7 days.
:::

### Response explained

| Parameter | Description / Example |
| --- | --- |
| `status` | "OK" always. |
| `hook` | "new" always, for a new incoming message. |
| `unique` | Unique ID for the incoming message. Use it as `replyTo` to quote the message in your reply, or to react to it with [Send Reaction](https://docs.99digital.co.il/whatsapp-api/send-reaction). |
| `from` | The contact person that sent you the message, in international format: `972501234567`. If the person is hiding their identity (enabled the [username](https://docs.99digital.co.il/whatsapp-api/information/username) feature), this value will return the `from_id`, for example `IL.1605856887361213`. |
| `from_id` | The contact person (sender) user id. It arrives whenever WhatsApp provides it, also when the client did not hide their identity; otherwise null. The format is always 2 letters country code + dot + 16 digits, for example `IL.1605856887361213`. This value is fixed per end user per WhatsApp API account. You can use this value to send messages to the client. |
| `username` | The username the client chose for their WhatsApp. This feature is not available yet and will return null until officially released by Meta. |
| `country` | The country code (two letters) of the contact person (sender), taken from their user id. Null when there is no user id. |
| `phone` | The contact person phone number, in international format, for example `972501234567`. If the phone number is not available (the client hides their identity), this will return null. |
| `to` | Your WhatsApp account. |
| `senderName` | The name of the person that sent the message. For type `phone`, the name they shared. |
| `type` | Message type. Can be one of the following: `text`, `image`, `audio`, `video`, `location`, `ptt`, `document`, `button`, `contacts`, `list`, `reaction`, `order`, `phone`. What arrives in `body` and `caption` for each type is in the tables below. |
| `body` | The content of the 'body' depends on the 'type' of the message — see "`body` by message type" below. |
| `caption` | The content of the 'caption' depends on the 'type' of the message — see "`caption` by message type" below. |
| `template` | The template name, if the client clicked on a quick reply button when getting the template ([Send a Template](https://docs.99digital.co.il/whatsapp-api/templates/send-a-template)). For everything else, this will return null. |
| `isForwarded` | Shows if the incoming message is forwarded — true or false. |
| `timestamp` | Time stamp of the incoming message (Unix time, in seconds, as a string). |
| `timestampMS` | The sub-second part of the timestamp (the digits after the decimal point of the time we processed the message), in case you need it. |
| `media` | If this message contains any media file, it will be true; otherwise false. |
| `quote` | If this message is a quoted message, it will be true; otherwise false. A reaction is always quoted: it points to the message the client reacted to. |
| `quoteUnique` | In case the message is quoted (it means that someone replied to your outgoing message), this will be the original message unique ID — for your own message, the `unique` you received when you sent it. For a reaction, the message the client reacted to. If the message is not quoted, this will be false. |
| `profilePic` | jpg file link to the client's profile picture, if the user has a profile picture and their privacy settings allow it; otherwise a link to a default image. Profile picture links are generated once per number. |
| `conversationTimeLeft` | Amount of minutes left for the incoming conversation session to end (up to 1435). If passed, any incoming message after that will be considered as a new incoming conversation, and the timer will reset. |
| `isNewConversation` | Whether this message started a new incoming message conversation session or not. 0 — this new message does not open a new conversation. 1 — this new message opens a new conversation. |
| `referral` | Object of items that describes the original referral that initiated the incoming WhatsApp message — see "`referral`" below. |
| `order` | Only for type `order`: the list of products of the order summary that was sent from your WhatsApp store — see "`order`" below. |

#### `body` by message type

| Type | The data that will come |
| --- | --- |
| text | Regular incoming message |
| image | A link to download the image file (jpg) |
| audio | A link to download the audio file (ogg) |
| video | A link to download the video file (mp4) |
| location | A location text in format `latitude,longitude` |
| ptt | A link to download the push to talk audio (voice message, ogg) |
| document | A link to download the document file |
| button | The text of the button that was selected |
| contacts | The phone number that was shared |
| list | The selection text from the list |
| reaction | The emoji that was sent — empty when the client removed their reaction |
| order | The note the client wrote with the order — the items are in `order` |
| phone | The phone number that was shared when the client revealed their phone number ([Request Phone](https://docs.99digital.co.il/whatsapp-api/request-phone)) |

You must download the link files to your server: we delete all files within
7 days. Documents are kept as pdf, zip, xls, xlsx, doc, docx, csv, apk, rar,
ppt, pptx or wav; a jpg, png or mp4 sent as a document arrives as `image` or
`video`. If a file could not be kept (for example a document of another file
type), `body` is empty and `media` is false.

#### `caption` by message type

| Type | The data that will come |
| --- | --- |
| text | Nothing, empty |
| image | Caption text with the image |
| audio | Nothing, empty |
| video | Caption text with the video |
| location | The name and address of the place (`name - address`), when the client shared a place; otherwise empty |
| ptt | Nothing, empty |
| document | Caption text with the document |
| button | The ID of the button that was selected. This ID arrives for the [Send Buttons](https://docs.99digital.co.il/whatsapp-api/send-buttons) and [Send Carousel](https://docs.99digital.co.il/whatsapp-api/send-carousel) button IDs, and for a template quick reply button (if you provided a quickReply button id) |
| contacts | The name of the contact |
| list | The item list ID that was selected ([Send List](https://docs.99digital.co.il/whatsapp-api/send-list)) |
| reaction | Nothing, empty |
| order | The store (catalog) ID number |
| phone | The name of the person that revealed their phone number |

The answer to [Request Location](https://docs.99digital.co.il/whatsapp-api/request-location) arrives as
type `location`.

#### `referral`

Object of items that describes the original referral that initiated the
incoming WhatsApp message. Available data:

| Field | Description |
| --- | --- |
| `ref_type` | `none` (for a non-referral incoming message), `post` (Facebook / Instagram post) or `ad` (Facebook / Instagram campaign). |

If the `ref_type` is `post` or `ad`, more information will be available:

| Field | Description |
| --- | --- |
| `ref_title` | The title of the post / ad. |
| `ref_body` | The message of the post / ad. |
| `ref_id` | ID of the post / ad. |
| `ref_link` | Link to the post / ad. |
| `ref_image` | Image of the original post / ad (the link will be deleted in 7 days). Null when there is no image. |

```json
"referral": {
  "ref_type": "ad",
  "ref_title": "Summer sale",
  "ref_body": "20% off everything",
  "ref_id": "120210000000000000",
  "ref_link": "https://fb.me/xyz123",
  "ref_image": "https://storage.99digital.online/files/1789900000Qw3Er4Ty5U.jpg"
}
```

#### `order`

This is the list of products of the order summary that was sent from your
WhatsApp store. This parameter is an array of items, and looks like this:

```json
"order": [
  {
    "product_retailer_id": "woo_92",
    "quantity": 2,
    "item_price": 24,
    "currency": "ILS"
  },
  {
    "product_retailer_id": "woo_70",
    "quantity": 3,
    "item_price": 10,
    "currency": "ILS"
  }
]
```

| Field | Description |
| --- | --- |
| `product_retailer_id` | The product ID of the item. |
| `quantity` | The quantity of that product. |
| `item_price` | The price of each product. |
| `currency` | The currency of that product. |

### Remarks

- Stickers and other message kinds that are not listed in `type` are not
  forwarded.
- In the text of `text`, `button` and `list` messages, in `senderName` and in
  contact names, a single quote (`'`) arrives as a backtick (`` ` ``).
- An example of every message type is under **Webhook payload** below.

## Webhook payload

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | string | Yes | "OK" always. One of: `OK`. |
| `hook` | string | Yes | "new" always, for a new incoming message. Always `new`. |
| `unique` | string | Yes | Unique ID for the incoming message. Use it as `replyTo` to quote the message in your reply, or to react to it with [Send Reaction](https://docs.99digital.co.il/whatsapp-api/send-reaction). Example: `92E004B950CCEA3C386FCFA2AAF8558A`. |
| `from` | string | Yes | The contact person that sent you the message, in international format: `972501234567`. If the person is hiding their identity (enabled the [username](https://docs.99digital.co.il/whatsapp-api/information/username) feature), this value will return the `from_id`, for example `IL.1605856887361213`. Example: `972501234567`. |
| `from_id` | string \| null | Yes | The contact person (sender) user id. It arrives whenever WhatsApp provides it, also when the client did not hide their identity; otherwise null. The format is always 2 letters country code + dot + 16 digits, for example `IL.1605856887361213`. This value is fixed per end user per WhatsApp API account. You can use this value to send messages to the client. Example: `IL.1605856887361213`. |
| `username` | null | Yes | The username the client chose for their WhatsApp. This feature is not available yet and will return null until officially released by Meta. |
| `country` | string \| null | Yes | The country code (two letters) of the contact person (sender), taken from their user id. Null when there is no user id. Example: `IL`. |
| `phone` | string \| null | Yes | The contact person phone number, in international format, for example `972501234567`. If the phone number is not available (the client hides their identity), this will return null. Example: `972501234567`. |
| `to` | string | Yes | Your WhatsApp account. Example: `972771234567`. |
| `senderName` | string | Yes | The name of the person that sent the message. For type `phone`, the name they shared. Example: `Dana Cohen`. |
| `type` | string | Yes | Message type. `ptt` is a voice message (push to talk). `button` and `list` are the client's choice in [Send Buttons](https://docs.99digital.co.il/whatsapp-api/send-buttons), [Send Carousel](https://docs.99digital.co.il/whatsapp-api/send-carousel), [Send List](https://docs.99digital.co.il/whatsapp-api/send-list) or a template quick reply button. `order` is a cart from your WhatsApp store. `phone` is the client's phone number, shared through [Request Phone](https://docs.99digital.co.il/whatsapp-api/request-phone). The answer to [Request Location](https://docs.99digital.co.il/whatsapp-api/request-location) arrives as `location`. One of: `text`, `image`, `audio`, `video`, `location`, `ptt`, `document`, `button`, `contacts`, `list`, `reaction`, `order`, `phone`. Example: `text`. |
| `body` | string | Yes | The content of the 'body' depends on the 'type' of the message: \| Type \| The data that will come \| \| --- \| --- \| \| text \| Regular incoming message \| \| image \| A link to download the image file (jpg) \| \| audio \| A link to download the audio file (ogg) \| \| video \| A link to download the video file (mp4) \| \| location \| A location text in format `latitude,longitude` \| \| ptt \| A link to download the push to talk audio (ogg) \| \| document \| A link to download the document file \| \| button \| The text of the button that was selected \| \| contacts \| The phone number that was shared \| \| list \| The selection text from the list \| \| reaction \| The emoji that was sent — empty when the client removed their reaction \| \| order \| The note the client wrote with the order — the items are in `order` \| \| phone \| The phone number that was shared when the client revealed their phone number \| You must download the link files to your server: we delete all files within 7 days. Documents are kept as pdf, zip, xls, xlsx, doc, docx, csv, apk, rar, ppt, pptx or wav; a jpg, png or mp4 sent as a document arrives as `image` or `video`. If a file could not be kept (for example a document of another file type), `body` is empty and `media` is false. Example: `Hi, is the store open today?`. |
| `caption` | string | Yes | The content of the 'caption' depends on the 'type' of the message: \| Type \| The data that will come \| \| --- \| --- \| \| text \| Nothing, empty \| \| image \| Caption text with the image \| \| audio \| Nothing, empty \| \| video \| Caption text with the video \| \| location \| The name and address of the place (`name - address`), when the client shared a place; otherwise empty \| \| ptt \| Nothing, empty \| \| document \| Caption text with the document \| \| button \| The ID of the button that was selected. This ID arrives for the `sendButtons` and `sendCarousel` button IDs, and for a template quick reply button (if you provided a quickReply button id) \| \| contacts \| The name of the contact \| \| list \| The item list ID that was selected \| \| reaction \| Nothing, empty \| \| order \| The store (catalog) ID number \| \| phone \| The name of the person that revealed their phone number \|. Example: ``. |
| `template` | string \| null | Yes | The template name, if the client clicked on a quick reply button of a template you sent ([Send a Template](https://docs.99digital.co.il/whatsapp-api/templates/send-a-template)). For everything else, this will return null. Example: `null`. |
| `isForwarded` | boolean | Yes | Shows if the incoming message is forwarded — true or false. Example: `false`. |
| `timestamp` | string | Yes | Time stamp of the incoming message (Unix time, in seconds, as a string). Example: `1789900000`. |
| `timestampMS` | integer | Yes | The sub-second part of the time we processed the message (the digits after the decimal point), in case you need it. Example: `483921`. |
| `media` | boolean | Yes | If this message contains a media file (`body` is a link to it), it will be true; otherwise false. Example: `false`. |
| `quote` | boolean | Yes | If this message is a quoted message, it will be true; otherwise false. A reaction is always quoted: it points to the message the client reacted to. Example: `false`. |
| `quoteUnique` | string \| boolean | Yes | In case the message is quoted (it means that someone replied to your outgoing message), this will be the original message unique ID — for your own message, the `unique` you received when you sent it. For a reaction, the message the client reacted to. If the message is not quoted, this will be false. Example: `false`. |
| `profilePic` | string | Yes | jpg file link to the client's profile picture, if the user has a profile picture and their privacy settings allow it; otherwise a link to a default image. Profile picture links are generated once per number. Example: `https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg`. |
| `conversationTimeLeft` | integer | Yes | Amount of minutes left for the incoming conversation session to end (up to 1435). If passed, any incoming message after that will be considered as a new incoming conversation, and the timer will reset. Example: `1435`. |
| `isNewConversation` | integer | Yes | Whether this message started a new incoming message conversation session or not. One of: `0` — This new message does not open a new conversation; `1` — This new message opens a new conversation. Example: `1`. |
| `referral` | object | Yes | Object of items that describes the original referral that initiated the incoming WhatsApp message. If the `ref_type` is 'post' or 'ad', more information is available. |
| `referral.ref_type` | string | Yes | The referral type. One of: `none` — Not a referral incoming message; `post` — Facebook / Instagram post; `ad` — Facebook / Instagram campaign. |
| `referral.ref_title` | string | No | The title of the post / ad. |
| `referral.ref_body` | string | No | The message of the post / ad. |
| `referral.ref_id` | string | No | ID of the post / ad. |
| `referral.ref_link` | string | No | Link to the post / ad. |
| `referral.ref_image` | string \| null | No | Image of the original post / ad (the link will be deleted in 7 days). Null when there is no image. |
| `order` | array of object | No | Only for type `order`: the list of products of the order summary that was sent from your WhatsApp store. |
| `order[].product_retailer_id` | string | No | The product ID of the item. Example: `woo_92`. |
| `order[].quantity` | integer | No | The quantity of that product. Example: `2`. |
| `order[].item_price` | number | No | The price of each product. Example: `24`. |
| `order[].currency` | string | No | The currency of that product. Example: `ILS`. |

### Example: Text

A regular incoming text message — here the first one of a new conversation.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "text",
  "body": "Hi, is the store open today?",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1435,
  "isNewConversation": 1,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Quoted reply

The client quoted your message: `quoteUnique` is the `unique` you received when you sent it.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "text",
  "body": "Yes, tomorrow at 10:00 works for me",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": true,
  "quoteUnique": "19545c3deca25da-0a504082ac7ad12-oiksAeQWvDMRtBQ",
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Image

`body` is a link to the image file (jpg), `caption` the text with it. Download it — we delete files within 7 days.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "image",
  "body": "https://storage.99digital.online/files/1789900000Ab3dE9fGh1.jpg",
  "caption": "My receipt",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": true,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Video

`body` is a link to the video file (mp4).

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "video",
  "body": "https://storage.99digital.online/files/1789900000Kp4LmN7qRs.mp4",
  "caption": "This is the noise it makes",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": true,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Audio

`body` is a link to the audio file (ogg); `caption` is empty.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "audio",
  "body": "https://storage.99digital.online/files/1789900000Wq2Er5TyUi.ogg",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": true,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Voice message (ptt)

A voice message (push to talk): `body` is a link to the audio (ogg); `caption` is empty.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "ptt",
  "body": "https://storage.99digital.online/files/1789900000Hj8Kl3ZxCv.ogg",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": true,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Document

`body` is a link to the document file, `caption` the text with it.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "document",
  "body": "https://storage.99digital.online/files/1789900000Zx9Yw8Vu7T.pdf",
  "caption": "Signed contract",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": true,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Location

`body` is `latitude,longitude`; `caption` is the name and address of the place the client shared.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "location",
  "body": "32.0853,34.7818",
  "caption": "Azrieli Center - Menachem Begin 132, Tel Aviv",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Location (Request Location)

The client shared their current location after Request Location: `caption` is empty.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "location",
  "body": "32.0853,34.7818",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Contact

A shared contact: `body` is the phone number, `caption` the name.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "contacts",
  "body": "972521112233",
  "caption": "Yossi Levi",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Button reply

A tap on a button of Send Buttons or Send Carousel: `body` is the button text, `caption` its ID.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "button",
  "body": "Track my order",
  "caption": "track_order",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": true,
  "quoteUnique": "19545c3deca25da-0a504082ac7ad12-oiksAeQWvDMRtBQ",
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Template quick reply

A tap on a quick reply button of a template: `caption` is the quickReply button id, `template` the template name.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "button",
  "body": "Confirm",
  "caption": "confirm",
  "template": "appointment_reminder",
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": true,
  "quoteUnique": "19545c3deca25da-0a504082ac7ad12-oiksAeQWvDMRtBQ",
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: List reply

A choice from Send List: `body` is the selection text, `caption` the item ID.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "list",
  "body": "Support",
  "caption": "support",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": true,
  "quoteUnique": "19545c3deca25da-0a504082ac7ad12-oiksAeQWvDMRtBQ",
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Reaction

`body` is the emoji; `quoteUnique` is the message the client reacted to.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "reaction",
  "body": "👍",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": true,
  "quoteUnique": "19545c3deca25da-0a504082ac7ad12-oiksAeQWvDMRtBQ",
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Order

A cart from your WhatsApp store: `order` lists the items, `body` is the client's note, `caption` the store ID.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "order",
  "body": "Please deliver after 18:00",
  "caption": "1234567890123456",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  },
  "order": [
    {
      "product_retailer_id": "woo_92",
      "quantity": 2,
      "item_price": 24,
      "currency": "ILS"
    },
    {
      "product_retailer_id": "woo_70",
      "quantity": 3,
      "item_price": 10,
      "currency": "ILS"
    }
  ]
}
```

### Example: Phone (Request Phone)

A client who hides their number shared it after Request Phone: `body` is the phone number, `caption` and `senderName` the name they shared.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "IL.1605856887361213",
  "from_id": "IL.1605856887361213",
  "username": null,
  "country": "IL",
  "phone": null,
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "phone",
  "body": "972501234567",
  "caption": "Dana Cohen",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/noprofile.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Hidden number

A client who hides their number: `from` is their user id and `phone` is null. Reply to the user id.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "IL.1605856887361213",
  "from_id": "IL.1605856887361213",
  "username": null,
  "country": "IL",
  "phone": null,
  "to": "972771234567",
  "senderName": "Dana",
  "type": "text",
  "body": "Hi, I saw your ad",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/noprofile.jpg",
  "conversationTimeLeft": 1380,
  "isNewConversation": 0,
  "referral": {
    "ref_type": "none"
  }
}
```

### Example: Ad referral

The conversation started from a Facebook / Instagram ad: `referral` describes it.

```json
{
  "status": "OK",
  "hook": "new",
  "unique": "92E004B950CCEA3C386FCFA2AAF8558A",
  "from": "972501234567",
  "from_id": null,
  "username": null,
  "country": null,
  "phone": "972501234567",
  "to": "972771234567",
  "senderName": "Dana Cohen",
  "type": "text",
  "body": "I would like to know more about the offer",
  "caption": "",
  "template": null,
  "isForwarded": false,
  "timestamp": "1789900000",
  "timestampMS": 483921,
  "media": false,
  "quote": false,
  "quoteUnique": false,
  "profilePic": "https://storage.99digital.online/profilePic/1789900000-ab12cd34.jpg",
  "conversationTimeLeft": 1435,
  "isNewConversation": 1,
  "referral": {
    "ref_type": "ad",
    "ref_title": "Summer sale",
    "ref_body": "20% off everything",
    "ref_id": "120210000000000000",
    "ref_link": "https://fb.me/xyz123",
    "ref_image": "https://storage.99digital.online/files/1789900000Qw3Er4Ty5U.jpg"
  }
}
```

## Responses

### 200 — Received. Answer with any 2xx status (200, 201, 204 …) — we wait up to 5 seconds to connect and up to 15 seconds for your answer. The body of your answer is ignored.

### default — Any other status, or no answer in time, counts as a failed delivery. With `retry` 1 in Set Webhook we try again: immediately, then after 5 minutes, 20 minutes, 1 hour, 4 hours and 24 hours. Without it, the webhook is not sent again.
