- Have a Google Account
- Get your Viber Account authentication token (you also need Viber account to get one-time code).
1. Download SurveyChatBot, keyboardGenerator and script.
2. Upload or import spreadsheet (SurveyChatBot.xlsx) to Google Docs.
- Access Token - Use the Access Token which you got during the Public Account creation.
4. Under the questions
sheet, you can delete rows starting from 2 or just leave one question to identify user (eg.: text, What's your surname?)
Open the Tools
> <> Script editor
a) Copy content of files and paste to new script. Rename. Create new +
> Script
. Repeat for another .gs file.
OR
b) Swtich to legacy mode and drug&drop file to editor (make sure you deleted default "function myFunction() { }". Repeat for another file.
Note: You must select the
Anyone
option for the "Who has access" dropdown or form responses will not be added to the spreadsheet!
8. Authorize the script to access your Google Sheet data on Google - Click Authorize access
. Then under advanced
click Go to...
, And Allow
.
Copy
the web app URL to your clipboard / note pad.
You need to send POST request to Viber API.
a) In Linux:
curl -s -X post https://chatapi.viber.com/pa/set_webhook -d '{"auth_token":"paste-your-token","url":"paste-your-web-app-URL-from-the-previous-step"}'
b) In Windows:
curl -s -X post https://chatapi.viber.com/pa/set_webhook -d "{\"auth_token\":\"paste-your-token\",\"url\":\"paste-your-web-app-URL-from-the-previous-step\"}"
c) In Firefox: F12
, Network
, go to this page, select request with file "set_webhook", edit and send again
, type POST as method, delete headers, put this in text: {"auth_token":"paste-your-token","url":"paste-your-web-app-URL-from-the-previous-step"}
and send
. Check new request > reply
.
If "ok" - share bot with users & collect user ids. If not "ok" - see Error codes.
10. Download media_viber.
Go to Administration
> Media types
, and import .xml.
Script parameters: paste your token.
10b. For legacy zabbix (<4.4.4) - download Viber.sh on zabbix server.
Move it to /usr/local/share/zabbix/alertscripts
(default, may be defined at zabbix_server.conf
).
Make executeble: chmod +x /usr/local/share/zabbix/alertscripts/Viber.sh
You can test it by executing: /usr/local/share/zabbix/alertscripts/Viber.sh your-auth-token viberid test-subj test-mess
Also you need to dowload media_viber-legacy, go to Administration
> Media types
, and import .xml.
> Limitations: you can't sent messages with symbols: '
,!
,"
.
Note: You may have to check
Actions menu
, soReport problems
sends via all media / Viber.