
Often, for a bot, you need to create a web server with a webhook for handle callbacks, then you need to write a code for sending requests and parsing responses from Viber. Since webhook requires a public server, we will use ngrok to publish our local server through a ngrok public URL. Unfortunately, Viber doesn’t provide long-polling for getting updates, instead, Viber uses webhooks and callbacks. Through the API you can send messages to a user and get different pieces of information. Viber has public API for working with a bot. After filling out information about the account, you can see the token for working with your public account.

Creating a public accountĬreating a public account is very simple. This article is a guide to creating simple Viber bot that will tell a local time in a selected city. With this API, we can create awesome bots.

Viber has public accounts (PA) and public API for working with them.
