As you might now I have just started working at a chatbot developer company and as preparation besides many other things I was reading through Viber's REST API documentation. I made some notes for myself and then I realized I could share them with you, maybe for some people it could be quite useful to have a summary.
Getting started
To be able to implement the API you need the followings:
- Active Viber Account
- Active Public account/ bot --> you can register one here
- Authentication key retrieved from your Public Account
- Account webhook
Example for Authentication key, which should be included in the HTTP Header of the requests:
X-Viber-Auth-Token: 445da6az1s345z78-dazcczb2542zv51a-e0vc5fva17480im9
Setting a webhook
Basic Text Message Example
Possible message types
- Picture
- Video
- File
- Contact
- Location (latitude, longitude)
- Url
- Sticker
- Carousel → side-scrollable multi-option panel
- Keyboard → multi-choice answer possibility
Broadcast message
Broadcast message allows you to send message to multiple receivers up to 300 people.
Change the key “receiver” to “broadcast_list” in the JSON:
Other basic API features
- Get user details
- Check if the user is online
- Post to public chat
Callbacks:
- Subscribe
- Unsubscribe
- Conversation started → response can be a welcome message
- Status (delivered/seen/failed)
Receive message from user
This was a brief summary of the API, I just wanted to list the key features and give some code examples. The whole, detailed description can be reached here:
http://developers.viber.com/docs/api/rest-bot-api/
Thanks for passing by!
Follow Upvote Resteem @goodguymate
OP Gaming
<I suggest Partiko if you are browsing from Android/iOS and would like to earn extra $>
🏆 Hi @goodguymate! You have received 0.1 STEEM reward for this post from the following subscribers: @steem12
Subscribe and increase the reward for @goodguymate :) | For investors.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit