Viber REST API Docs | Summary

in programming •  6 years ago 

image.png

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

image.png

Basic Text Message Example

image.png

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:

image.png

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

image.png

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



Steem Gaming Community
ya6cczq3qa.png
OP Gaming

<I suggest Partiko if you are browsing from Android/iOS and would like to earn extra $>

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

🏆 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.