Viber
This section covers the library for working with Viber API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
As of 02/05/2024, this method of creating bots is no longer valid: Rakuten has discontinued the ability to create bots for free, and now working with the API requires verification under a commercial model. Learn more here
Methods in this library have not been tested since 01/10/2025
Getting Started
Viber has two REST API variants: for working with channels and for chat bots. In both cases, the main parameters for operation are Token and UserID.
Channel Management
- Open the Viber application and create a new channel
- After creation, go to channel settings -> For developers, and copy the channel Token
- Set up a Webhook to receive updates. See Set webhook
- UserID - your ID or the channel administrator's ID. See Get channel information
Chat Bot Management
- Go to the Viber Partner Cabinet and log in with your phone number linked to Viber
- Select the option to create a new bot
- Fill in all required fields in the bot creation menu
- Copy the Token
- Get information about your bot by scanning the QR code on the creation page or in the settings (bots section) in the Viber application
- Set up a Webhook to receive updates. See Set webhook
When working with a chat bot, the UserID will be the ID of the specific person you're communicating with. This can be obtained when processing incoming messages via Webhook.
Important: The ID of the same user for chat and channel have different values. You cannot use an ID obtained from a bot message to call channel management methods and vice versa.