Create Viber chatbot in API.chat

To create a Viber chatbot first you need to navigate to the partners page and login with your Viber account. After you press Create Bot Account button you will be forwarded to a form for a new chatbot.

partners.PNG

At this basic form, you should fill in all data, Account name will be your chatbot public name, and URI - system bot name, which will be used in links. You can change most of the parameters later, except URI and location.

After you create a chatbot you will get an auth token, copy it for later use.

Connect Viber chatbot as a channel

Next, you need to connect the Viber channel to a previously created chatbot. That could be done with Viber Channel API, use Viber connect channel endpoint to connect chatbot.

To connect the channel you need to provide AuthToken and the name of a chatbot which will be the name of the sender from the chatbot side.

-- CODE lang-bash -- curl -v -X POST "https://bot.api.chat/channels/viber/yourBotName" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Ocp-Apim-Subscription-Key: your-sub-key" --data-raw '{ "AuthToken": "your-token", "SenderName": "name-of-answers-sender" }'

On success, you will get full information about the channel and about the bot account you created earlier.

carbon (37).png

Don't miss these stories: