Receiving notifications via HTTP API#
You can receive incoming notifications (messages, statuses) through HTTP API requests in the same way as the other Telegram messenger API methods are implemented.
At the same time, the chronological order of notifications is guaranteed in the sequence in which they were received, FIFO.
All incoming notifications are stored in the queue and wait to be received for 24 hours.
To receive incoming notifications, you need to call two methods sequentially:
- The ReceiveNotification method receives an incoming notification.
- The DeleteNotification method confirms the successful receipt and processing of the notification.
Instance configuration#
Before receiving incoming notifications, you need to configure the instance.
The instance can be configured programmatically using the SetSettings method, or interactively in the console interface.
Configuration using the SetSettings method#
To set up receiving incoming notifications with the HTTP API technology, you need to leave the webhookUrl parameter empty.
You also need to specify which kinds of notifications you need to receive.
Request body example for the SetSettings method#
{
"webhookUrl": "",
"outgoingWebhook": "yes",
"stateWebhook": "yes",
"incomingWebhook": "yes"
}
Configuration in the console#
- Go to the console
- Select the instance whose settings you need to change
- Click the
Changebutton on the instance panel - Turn on the toggles for the required kinds of notifications
- Click the
Save changesbutton to apply the settings.
Receiving incoming notifications#
After configuring the instance, you can start receiving notifications using the ReceiveNotification and DeleteNotification methods.
A detailed description of the incoming notification format is presented in the Incoming notifications format section.