Sending messages to users is done based on the user ID. The user ID is unique for each user and provided to you with any callback triggered by a user’s action. There is currently no option to send messages based on phone numbers.
Your token is generated and provided to you during the Public Account creation process. As a Public Account administrator, you can always find the account token in the “edit info” page.
Tokens are permanent and do not expire unless changed by the Viber team.
Refreshing your token can only be done by Viber support team. If you believe your authentication token has been compromised please contact Viber support to get a new one.
In case the webhook is offline Viber will re-try to deliver the callback several times for up to an hour until HTTP status code
200 OK is received.
Only one webhook per Public Account is currently supported.
The same webhook can be set for more than one Public Account.
There are a few steps you can take if you’re not getting callbacks to your token:
get_account_inforequest to see that your webhook is set correctly.
seen) you may choose whether or not to receive them during the
The endpoint certificate authority should be on the Sun Java trusted root certificates list.
The user ID is available to you in all callbacks received from our server. Keep in mind that before you can message a user he must subscribe to your PA or send you a message.
User ID is unique per user and per Public Account. This means that the same user will have different user IDs on each Public Account.
User IDs do not change or expire. Each user has a unique and permanent ID when communicating with a Public Account. The user ID will only change if the user activated Viber with a different number, as this will create a completely new Viber account. Keep in mind that the same user will have a different user ID on each Public Account.
The maximum JSON size for all API requests is 30kb. The keyboard can contain up to 12 rows in portrait mode.
Most keyboard validations take place on the client. If the request is successfully sent to the client and then fails one of the client validations you will receive a “failed” callback. The flow for such a case will be as follows:
Failedcallback is sent to the webhook, containing the unique message token and a string explaining the failure.
Viber will always display the last keyboard sent to the user.