Viber
This section is dedicated to the library for working with Viber API. On this page, all the steps necessary to start working are described
Starting from February 5, 2024, this method of creating bots is no longer valid: Rakuten has canceled the ability to create bots for free, and now working with the API requires verification under a commercial model. More details here
Getting started
For Viber, there are two REST APIs: one for working with channels and the other for chatbots. In both cases, the main parameters are Token and UserID
-
If you need to manage a channel:
- Open the Viber app and create a new channel
- After creation, go to the channel settings -> For developers, and copy the Token
- Set webhook (see Set webhook)
- UserID - your ID (channel administrator). See Get Channel Information for details
-
If you need a chatbot:
- Go to the link https://partners.viber.com/account/create-bot-account and authorize yourself with your phone number linked to Viber
- Select the option to create a new bot
- In the bot creation menu, fill in all the required fields
- Copy the Token
- To find your new bot, you can scan the QR code on the creation page or in the settings (chat bots section) within the Viber app.
- You cannot start a conversation with the bot right now. First, you need to set up a webhook. See Set Webhook
- After launch, the User ID will be the ID of the specific person engaging with the bot. You can obtain it from processing incoming messages via Webhook
Important: The ID of the same user in chat and channel is different. You cannot use the ID obtained from a message to the bot to invoke channel management methods and vice versa