Viber REST API Docs | Summary

in #programming6 years ago

image.png

<p dir="auto">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. <h1>Getting started <p dir="auto">To be able to implement the API you need the followings: <ul> <li>Active Viber Account <li>Active Public account/ bot --> you can register one <a href="https://partners.viber.com" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here <li>Authentication key retrieved from your Public Account <li>Account webhook <p dir="auto">Example for Authentication key, which should be included in the HTTP Header of the requests:<br /> <em>X-Viber-Auth-Token: 445da6az1s345z78-dazcczb2542zv51a-e0vc5fva17480im9 <h3>Setting a webhook <p dir="auto"><center><img src="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmSe1QGiwduEpgrKix1sCtXFTv7YbtwSEuxkEqZLumsYhZ" alt="image.png" srcset="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmSe1QGiwduEpgrKix1sCtXFTv7YbtwSEuxkEqZLumsYhZ 1x, https://images.hive.blog/1536x0/https://ipfs.busy.org/ipfs/QmSe1QGiwduEpgrKix1sCtXFTv7YbtwSEuxkEqZLumsYhZ 2x" /> <h3>Basic Text Message Example <p dir="auto"><center><img src="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmafgUCzeG3fdsZHL4yBQ9UBAEbrHbkk5437z7CVcEA4wb" alt="image.png" srcset="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmafgUCzeG3fdsZHL4yBQ9UBAEbrHbkk5437z7CVcEA4wb 1x, https://images.hive.blog/1536x0/https://ipfs.busy.org/ipfs/QmafgUCzeG3fdsZHL4yBQ9UBAEbrHbkk5437z7CVcEA4wb 2x" /> <h3>Possible message types <ul> <li>Picture <li>Video <li>File <li>Contact <li>Location (latitude, longitude) <li>Url <li>Sticker <li>Carousel → side-scrollable multi-option panel <li>Keyboard → multi-choice answer possibility <h3>Broadcast message <p dir="auto">Broadcast message allows you to send message to multiple receivers up to 300 people.<br /> Change the key “receiver” to “broadcast_list” in the JSON: <p dir="auto"><center><img src="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmNxwBSwerL2gVq3YjV6XfzgyqrR8F957romLhtKAcuaiW" alt="image.png" srcset="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmNxwBSwerL2gVq3YjV6XfzgyqrR8F957romLhtKAcuaiW 1x, https://images.hive.blog/1536x0/https://ipfs.busy.org/ipfs/QmNxwBSwerL2gVq3YjV6XfzgyqrR8F957romLhtKAcuaiW 2x" /> <h3>Other basic API features <ul> <li>Get user details <li>Check if the user is online <li>Post to public chat <h3>Callbacks: <ul> <li>Subscribe <li>Unsubscribe <li>Conversation started → response can be a welcome message <li>Status (delivered/seen/failed) <h3>Receive message from user <p dir="auto"><center><img src="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmRtPt5njTt3yu2EmxWUQkUerEwaNcGpXthd8WjMYjeYSY" alt="image.png" srcset="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmRtPt5njTt3yu2EmxWUQkUerEwaNcGpXthd8WjMYjeYSY 1x, https://images.hive.blog/1536x0/https://ipfs.busy.org/ipfs/QmRtPt5njTt3yu2EmxWUQkUerEwaNcGpXthd8WjMYjeYSY 2x" /> <p dir="auto">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:<br /><span> <a href="http://developers.viber.com/docs/api/rest-bot-api/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://developers.viber.com/docs/api/rest-bot-api/ <p dir="auto">Thanks for passing by! <p dir="auto"><code>Follow Upvote Resteem @goodguymate <hr /> <p dir="auto"><br /> <center><a href="https://discordapp.com/invite/URQY4zx" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Steem Gaming Community<br /> <img src="https://images.hive.blog/768x0/https://img.esteem.ws/ya6cczq3qa.png" alt="ya6cczq3qa.png" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/ya6cczq3qa.png 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/ya6cczq3qa.png 2x" /><br /> <a href="https://discordapp.com/invite/zTe8ySf" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">OP Gaming<span><img src="https://images.hive.blog/768x0/https://media.discordapp.net/attachments/406891902101880853/540998462934876161/SGC_Wallpaper_No_particles_.png?width=1442&height=202" srcset="https://images.hive.blog/768x0/https://media.discordapp.net/attachments/406891902101880853/540998462934876161/SGC_Wallpaper_No_particles_.png?width=1442&height=202 1x, https://images.hive.blog/1536x0/https://media.discordapp.net/attachments/406891902101880853/540998462934876161/SGC_Wallpaper_No_particles_.png?width=1442&height=202 2x" /> <p dir="auto"><em><I suggest <a href="https://partiko.app/referral/goodguymate" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Partiko if you are browsing from Android/iOS and would like to earn extra $>
Sort:  

🏆 Hi @goodguymate! You have received 0.1 STEEM reward for this post from the following subscribers:
Subscribe and increase the reward for @goodguymate :) | For investors. @steem12