Use Viber on your smartphone, tablet and computer when you’re connected to a Wi-Fi, 3G or 4G network.

Telegram & Viber Chatbot user manual

Telegram & Viber Chatbot user manual

Everything you need to find is PlagiarismSearch.com on Telegram or Viber, and then insert the text that has to be checked (or upload the necessary document). In this case, you will have a single account with the common balance and reports history.

Viber REST API

Viber REST API

Note: an active Viber account is needed to receive the login code to access the bot creation page. Enabling this URL is part of the paid services we offer to official partners.

Likewise, after creating your bot it will not appear in search results in Viber, and enabling this also part of the paid services we offer to official partners. If you’re interested in discussing a partnership agreement or know more about the paid channels to promote your bot on Viber, please email [email protected] and include your company details, including your company’s country. The following diagram describes the flow of sending and receiving messages by the account. All API requests and callbacks mentioned in the diagram will be explained later in this document. The authentication token (also known as application key) is a unique and secret account identifier. Each API request must include an HTTP Header called X-Viber-Auth-Token containing the account’s authentication token.

Note: Failing to send the authentication token in the header will result in an error with the missing_auth_token message. Setting the webhook will be done by calling the set_webhook API with a valid & certified URL.

For security reasons only URLs with valid and official SSL certificate from a trusted CA will be allowed. Once a set_webhook request is sent Viber will send a callback to the webhook to check its availability and return a response to the user.

Viber’s API allows you to receive user names and photos. This has been updated to comply with privacy laws and allow developers who don’t make use of user names and photos as part of their service to opt out.

Note: This feature will work if the user has allowed “Content Personalisation” (More → Privacy → personal data). If the user has disallowed content personalization, you will receive placeholder values.

Account webhook URL to receive callbacks & messages from users Webhook URL must use SSL Note: Viber doesn’t support self signed certificates event_types optional. Don’t include this parameter in your request to get all events Possible values: delivered , seen , failed , subscribed , unsubscribed and conversation_started send_name optional.

Name Description Possible values status Action result 0 for success. See error codes table for additional information status_message ok or failure reason Success: ok . See error codes table for additional information event_types List of event types you will receive a callback for.

Should return the same values sent in the request delivered , seen , failed , subscribed , unsubscribed and conversation_started. Sending a set_webhook request with empty event_types list ("event_types": []) means getting only mandatory events. For each set_webhook request Viber will send a callback to the webhook URL to confirm it is available. Once you set a webhook to your bot your 1-on-1 conversation button will appear and users will be able to access it.

Account webhook URL to receive callbacks & messages from users. In this case, use an empty string to remove any previously set webhook.

The API supports a variety of message types: text , picture , video , file , location , sticker , contact , carousel content and URL . Specific post data examples and required parameters for each message type are given below.

{ "status" : 12 , "status_message" : "maximum messages from Public Account to Viber user without reply exceeded.". Name Description Validation receiver Unique Viber user id required, subscribed valid user id type Message type required.

Available message types: text , picture , video , file , location , contact , sticker , carousel content and url sender.name The sender’s name to display required. Recommended 720x720 tracking_data Allow the account to track messages and user’s replies. max 4000 characters min_api_version Minimal API version required by clients for this message (default 1) optional. Below is a list of all supported message types with post data examples.

Max 512 characters media URL of the image (JPEG, PNG, non-animated GIF) required. thumbnail URL of a reduced size image (JPEG, PNG, GIF) optional. Max 180 seconds thumbnail URL of a reduced size image (JPEG) optional. { "receiver" : "01234567890A=" , "min_api_version" : 1 , "sender" :{ "name" : "John McClane" , "avatar" : "http://avatar.example.com" }, "tracking_data" : "tracking data" , "type" : "sticker" , "sticker_id" : 46105 }. The Rich Media message type allows sending messages with pre-defined layout, including height (rows number), width (columns number), text, images and buttons. Below you will find an exmaple of a Carousel Content Message, that allows a user to scroll through a list of items, each composed of an image, description and call to action button.

Carousel Content Message is supported on devices running Viber version 6.7 and above. { "receiver" : "nsId6t9MWy3mq09RAeXiug==" , "type" : "rich_media" , "min_api_version" : 7 , "rich_media" :{ "Type" : "rich_media" , "ButtonsGroupColumns" : 6 , "ButtonsGroupRows" : 7 , "BgColor" : "#FFFFFF" , "Buttons" :[ { "Columns" : 6 , "Rows" : 3 , "ActionType" : "open-url" , "ActionBody" : "https://www.google.com" , "Image" : "http://html-test:8080/myweb/guy/assets/imageRMsmall2.png" }, { "Columns" : 6 , "Rows" : 2 , "Text" : "Headphones with Microphone, On-ear Wired earphones
Sound Intone
$17.99" , "ActionType" : "open-url" , "ActionBody" : "https://www.google.com" , "TextSize" : "medium" , "TextVAlign" : "middle" , "TextHAlign" : "left" }, { "Columns" : 6 , "Rows" : 1 , "ActionType" : "reply" , "ActionBody" : "https://www.google.com" , "Text" : "Buy" , "TextSize" : "large" , "TextVAlign" : "middle" , "TextHAlign" : "middle" , "Image" : "https://s14.postimg.org/4mmt4rw1t/Button.png" }, { "Columns" : 6 , "Rows" : 1 , "ActionType" : "reply" , "ActionBody" : "https://www.google.com" , "Text" : "MORE DETAILS" , "TextSize" : "small" , "TextVAlign" : "middle" , "TextHAlign" : "middle" }, { "Columns" : 6 , "Rows" : 3 , "ActionType" : "open-url" , "ActionBody" : "https://www.google.com" , "Image" : "https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png" }, { "Columns" : 6 , "Rows" : 2 , "Text" : "Hanes Men's Humor Graphic T-Shirt
Hanes
$10.99" , "ActionType" : "open-url" , "ActionBody" : "https://www.google.com" , "TextSize" : "medium" , "TextVAlign" : "middle" , "TextHAlign" : "left" }, { "Columns" : 6 , "Rows" : 1 , "ActionType" : "reply" , "ActionBody" : "https://www.google.com" , "Text" : "Buy" , "TextSize" : "large" , "TextVAlign" : "middle" , "TextHAlign" : "middle" , "Image" : "https://s14.postimg.org/4mmt4rw1t/Button.png" }, { "Columns" : 6 , "Rows" : 1 , "ActionType" : "reply" , "ActionBody" : "https://www.google.com" , "Text" : "MORE DETAILS" , "TextSize" : "small" , "TextVAlign" : "middle" , "TextHAlign" : "middle" } ] } }. Name Description Possible values alt_text Backward compatibility text, limited to 7,000 characters rich_media.ButtonsGroupColumns Number of columns per carousel content block. Default 6 columns 1 - 6 rich_media.ButtonsGroupRows Number of rows per carousel content block.

Default 7 rows 1 - 7 rich_media.Buttons Array of buttons Max of 6 * ButtonsGroupColumns * ButtonsGroupRows. The keyboards are fully customizable and can be created and designed specifically for the account’s needs.

The API supports a variety of message types: text , picture , video , file , location , sticker , contact , carousel content and URL . The Broadcast API is used to send messages to multiple recipients with a rate limit of 500 requests in a 10 seconds window. The following example demonstrates send carousel content with place holders ( replace_me_with_receiver_id , replace_me_with_url_encoded_receiver_id , replace_me_with_user_name ) to 4 receivers:.

{ "sender" :{ "name" : "John McClane" , "avatar" : "http://avatar.example.com" }, "min_api_version" : 2 , "type" : "rich_media" , "broadcast_list" :[ "pttm25kSGUo1919sBORWyA==" , "2yBSIsbzs7sSrh4oLm2hdQ==" , "EGAZ3SZRi6zW1D0uNYhQHg==" , "kBQYX9LrGyF5mm8JTxdmpw==" ], "rich_media" :{ "Type" : "rich_media" , "BgColor" : "#FFFFFF" , "Buttons" :[ { "ActionBody" : "https://www.google.com" , "ActionType" : "open-url" , "Text" : "Should get back my ID instead of replace_me_with_receiver_id" }, { "ActionBody" : "https://www.google.com" , "ActionType" : "open-url" , "Text" : "Should get back my URL encoded ID instead of replace_me_with_url_encoded_receiver_id" }, { "ActionBody" : "https://www.google.com" , "ActionType" : "open-url" , "Text" : "Should get back my name instead of replace_me_with_user_name" } ] } }. Name Description Possible values message_token Unique ID of the message status Action result 0 for success.

See error codes table for additional information status_message ok or failure reason Success: ok . Name Description Possible values status Action result 0 for success.

See error codes table for additional information status_message ok or failure reason Success: ok . Will be used for finding accounts near me lat & lon coordinates country Account country 2 letters country code - ISO ALPHA-2 Code webhook Account registered webhook webhook URL event_types Account registered events – as set by set_webhook request delivered , seen , failed and conversation_started subscribers_count Number of subscribers members Members of the bot’s public chat id , name , avatar , role for each Public Chat member (admin/participant).

{ "status" : 0 , "status_message" : "ok" , "message_token" : 4912661846655238145 , "user" :{ "id" : "01234567890A=" , "name" : "John McClane" , "avatar" : "http://avatar.example.com" , "country" : "UK" , "language" : "en" , "primary_device_os" : "android 7.1" , "api_version" : 1 , "viber_version" : "6.5.0" , "mcc" : 1 , "mnc" : 1 , "device_type" : "iPhone9,4" } }. Name Description Possible values status Action result 0 for success.

See error codes table for additional information status_message ok or failure reason Success: ok . ISO 639-1 user.primary_device_os The operating system type and version of the user’s primary device. user.api_version Max API version, matching the most updated user’s device Currently only 1.

Additional versions will be added in the future user.viber_version The Viber version installed on the user’s primary device user.mcc Mobile country code user.mnc Mobile network code user.device_type The user’s device type. The get_online request will fetch the online status of a given subscribed account members.

Name Description Possible values status Action result 0 for success. See error codes table for additional information status_message ok or failure reason Success: ok .

The signature is HMAC with SHA256 that will use the authentication token as the key and the JSON as the value. The result will be passed as HTTP Header X-Viber-Content-Signature so the receiver can determine the origin of the message. In case the webhook is offline Viber will re-try to deliver the callback until HTTP status code 200 is received. Note: A subscribe event will delete any context or tracking_data information related to the conversation.

{ "event" : "subscribed" , "timestamp" : 1457764197627 , "user" :{ "id" : "01234567890A=" , "name" : "John McClane" , "avatar" : "http://avatar.example.com" , "country" : "UK" , "language" : "en" , "api_version" : 1 }, "message_token" : 4912661846655238145 }. Name Description Possible values event Callback type - which event triggered the callback unsubscribed timestamp Time of the event that triggered the callback Epoch time user_id Unique Viber user id message_token Unique ID of the message. This event is not considered a subscribe event and doesn’t allow the account to send messages to the user; however, it will allow sending one “welcome message” to the user. Once a conversation_started callback is received, the service will be able to respond with a JSON containing same parameters as a send_message request.

{ "event" : "conversation_started" , "timestamp" : 1457764197627 , "message_token" : 4912661846655238145 , "type" : "open" , "context" : "context information" , "user" :{ "id" : "01234567890A=" , "name" : "John McClane" , "avatar" : "http://avatar.example.com" , "country" : "UK" , "language" : "en" , "api_version" : 1 }, "subscribed" : false }. The Viber API allows sending messages to users only after they subscribe to the account.

The welcome message will be sent as a response to a conversation_started callback, which will be received from Viber once the user opens the conversation with the account. To learn more about this event and when is it triggered see Conversation started in the callbacks section. The welcome message will be a JSON constructed according to the send_message requests structure, but without the receiver parameter.

{ "sender" :{ "name" : "John McClane" , "avatar" : "http://avatar.example.com" }, "tracking_data" : "tracking data" , "type" : "picture" , "text" : "Welcome to our bot!". Note: The welcome message should be sent as the body of the HTTP response to the conversation_started callback, and not to the send_message endpoint.

Name Description Possible values event Callback type - which event triggered the callback delivered , seen timestamp Time of the event that triggered the callback Epoch time message_token Unique ID of the message user_id Unique Viber user id. “Failed” callback is sent to the webhook, containing the unique message token and a string explaining the failure.

Name Description Possible values event Callback type - which event triggered the callback failed timestamp Time of the event that triggered the callback Epoch time message_token Unique ID of the message user_id Unique Viber user id desc A string describing the failure. The Chat API allows the user to send messages to the PA.

These include: text , picture , video , contact , URL and location . The following callback data describes the structure of messages sent from user to PA. { "event" : "message" , "timestamp" : 1457764197627 , "message_token" : 4912661846655238145 , "sender" :{ "id" : "01234567890A=" , "name" : "John McClane" , "avatar" : "http://avatar.example.com" , "country" : "UK" , "language" : "en" , "api_version" : 1 }, "message" :{ "type" : "text" , "text" : "a message to the service" , "media" : "http://example.com" , "location" :{ "lat" : 50.76891 , "lon" : 6.11499 }, "tracking_data" : "tracking data" } }.

Name Description Possible values type Message type text , picture , video , file , sticker , contact , url and location text The message text media URL of the message media - can be image , video , file and url . Once a 200 OK response is received from the PA, the message status will change to delivered on the user’s side. Value Name Description 0 ok Success 1 invalidUrl The webhook URL is not valid 2 invalidAuthToken The authentication token is not valid 3 badData There is an error in the request itself (missing comma, brackets, etc.). The bot is missing a Public Chat interface 19 cannotSendBroadcast Cannot send broadcast message 20 broadcastNotAllowed Attempt to send broadcast message from the bot other General error General error. Note: Failing to send the authentication token in the header will result in an error with the missing auth_token message.

Chat bots in WhatsApp, Viber, Telegram and other messengers

Chat bots in WhatsApp, Viber, Telegram and other messengers

Chat2Desk has conducted its own study to understand how automation is going to help HR Departments in the coming years.

Related Posts

Leave a reply