Event: Online
Webhook
For every Online omnichannel event, you will get a webhook (event "online"). Fields that don't belong to the event (for example inboxID when an account is created) are empty strings.
Settings:
| Setting | Value |
|---|---|
| URL | Your URL — set it with Set Webhook |
| Method | JSON via POST |
online_extra_info | Sent by |
|---|---|
| 1 — new account | Create a new online account, or the partners dashboard |
| 2 — active, 3 — suspended | Update account with account_status 1 or 0 |
| 4 — account deleted | Delete an account, or the partners dashboard |
| 5 — new WhatsApp inbox | Create a new WhatsApp Inbox, or the partners dashboard |
| 6 — WhatsApp inbox deleted | Delete a WhatsApp Inbox, or the partners dashboard |
| 7 — agent login link | Login to an agent |
With every Online omnichannel event, you will get some of the following:
{
"status": "OK",
"event": "online",
"accountID": 523,
"inboxID": "",
"agentID": 14,
"server": "online",
"online_reference": "5234-my-code",
"online_extra_info": 1
}
Response explained
| Parameter | Description / Example |
|---|---|
status | "OK" always. |
event | "online" always. |
accountID | The account ID. |
inboxID | The inbox ID — with online_extra_info 5 and 6. An empty string with the other events. |
agentID | The agent ID — with online_extra_info 1 (the account's admin agent) and 7 (the agent of the login link). An empty string with the other events. |
server | The server subdomain of the account. |
online_reference | The reference value that was provided by you when creating the Online account (online_extra_info 1) or the WhatsApp inbox (5). An empty string with the other events. |
online_extra_info | A number related to the Online update event — when will you get this webhook. See the values below. |
online_extra_info
| Value | Explanation |
|---|---|
| 1 | A new account was created. |
| 2 | The account status changed to "active". |
| 3 | The account status changed to "suspended". |
| 4 | The account was deleted. |
| 5 | A new WhatsApp inbox was created. |
| 6 | A WhatsApp inbox was deleted. |
| 7 | A new agent login link was created. |
Webhook payload
Your response
- 200
- default
Received. Answer with a 2xx status (200 OK) within 10 seconds, and process the webhook afterwards. The body of your answer is ignored.
Any other answer, or no answer in time, is a failed delivery. There are no retries: a webhook that was not delivered is not sent again.