Messenger webhooks (im integration channel)

Overview

Receives messenger webhooks (whatsapp, vk, max in webhook mode) and passes them to the IM account servicing service. Scripts are not used.

:TOKEN — the integration channel token of type im of the IM account (the address is in the account webhookInfo.url). A token of another type is rejected as unknown (404); the im token is not accepted by other interfaces.

Requests

HTTP verb Endpoint Description

GET

/api/im/v1/:TOKEN

Connection check from the messenger side

POST

/api/im/v1/:TOKEN

Webhook for incoming messages from the messenger

Connection check from the messenger side

Used for 'whatsapp' accounts when verifying the registered URL (in webhook mode).

Request

Example requests
GET /api/im/v1/a55c54b59ee6c8cfab2f83e33c2474d3?hub.challenge=SAMPLE_CHALLENGE&hub.verify_token=15151515-1515-1515-1515-151515151515 HTTP/1.1

Response

Example response
HTTP/1.1 200 OK

SAMPLE_CHALLENGE

Webhook for incoming messages from the messenger

Used for 'whatsapp' and 'vk' accounts (in webhook mode).

Request

Example request from whatsapp_business
POST /api/im/v1/a55c54b59ee6c8cfab2f83e33c2474d3 HTTP/1.1
Content-Type: application/json

<JSON content>

Response

Example response
HTTP/1.1 204 No Content