Integrating Outbound Viber Messages with Atmosphere®
This tutorial describes how to send outbound messages using Atmosphere® to Viber users. Viber allows accounts to send messages to other Viber users who subscribe to the account. Viber supports a variety of message type (text, picture, video, file, location, sticker, contact, carousel content and URL). For this tutorial we will look at how to send a simple text message. For information on how to send other messaging types, check out the Viber documentation.
To enable outbound messaging, you will need the following:
- An IntelePeer Atmosphere® account: You can sign up for an account here.
- A Viber account: You will need to log onto the platform from a mobile device to create an account.
- An API request tool: Several free tools exist including, cURL, Postman, and Fiddler. The choice on which one is best to use is yours.
Note: The example function code in Python is provided as-is. Adapt the example to your use case, or design your own in your preferred programming language.
- Create A Viber Bot: Once you have logged into Viber, you will select Create Bot Account from the left-hand navigation pane.
- Complete the webform: A webhook (also called a web callback or HTTP push API) is a way for Viber to provide your applications with real-time information.
- Click Create.
- Your bot will be created and note your Account Authentication Token. This token is a unique account identifier used to authorize any API request.
- Add an External Web Call action to your flow.
- Go to the ADD HEADER section and add the following key / value pair:
- KEY: X-Viber-Auth-Token
- Token: Your Viber Account Authentication Token
- Configure the action as follows:
URL OF SERVICE: https://chatapi.viber.com/pa/send_message
"name":"My Company Name"
Only required fields have been added to the example. For detailed information on these and optional parameters, check out the Viber documentation.
- Save and Deploy your flow.