Teams serving customers across Eastern Europe and Southeast Asia often manage Viber Business messages inside isolated bot dashboards detached from Perfex CRM client records. Without unified routing, agents miss customer context and cannot convert Viber chats into trackable tickets.
PolyUtilities v3.7.0 connects your official Viber Business Bot directly to Perfex CRM Unified Inbox via Poly_omnichat_viber_adapter, verifying X-Viber-Content-Signature HMAC-SHA256 headers and enabling 1-click AI Copilot replies without middleware.
Ensure OmniChat external channels are activated first by reviewing the Guide to Install and Use PolyUtilities for Perfex CRM.
| Viber Configuration Item | Where to Obtain | Technical Behavior in PolyUtilities |
|---|---|---|
| Account ID | Bot URI or Name (for example mycompany_support) | Identifies the Viber bot channel inside Unified Inbox |
| Token / API Key | Viber Admin Panel (partners.viber.com) Auth Token | Authenticates outbound chatapi.viber.com/pa/send_message |
| App Secret / Webhook Secret | Same Viber Bot Auth Token | Verifies HMAC-SHA256 X-Viber-Content-Signature |
| Webhook URL | https://your-crm-domain.com/poly_utilities/omnichat/webhook/viber | Registered via POST to https://chatapi.viber.com/pa/set_webhook |
1. Create Your Viber Bot and Register the Webhook
Viber signs every incoming webhook payload using your Bot Auth Token as the HMAC-SHA256 secret key. Saving your channel in Perfex CRM before invoking set_webhook ensures that Viber’s immediate handshake ping receives an HTTP 200 JSON response from Poly_omnichat_webhook.
- Sign in to the Viber Admin Panel with your Viber phone number, click Create Bot Account, and copy the generated Auth Token.
- Open OmniChat Settings > Channels in Perfex CRM, choose Viber Bot, enter your Bot URI in Account ID, and paste the same Auth Token into both Token / API Key and App Secret / Webhook Secret, then click Save Channel.
- Send a POST request to
https://chatapi.viber.com/pa/set_webhookwith headerX-Viber-Auth-Token: YOUR_TOKENand JSON body{"url":"https://your-crm-domain.com/poly_utilities/omnichat/webhook/viber","event_types":["message","conversation_started"]}.
2. Handle Media, AI Replies, and Cross-Channel Inbox Operations
Inbound Viber messages and media from dl-media.viber.com pass through PolyUtilities’ SSRF-pinned downloader and 10-layer file security checks, landing cleanly beside Twilio SMS and Email IMAP/SMTP conversations. Agents can run AI Vision on customer screenshots, reply with slash canned macros, or escalate chats into Perfex Tickets.
- Confirm your Perfex domain serves a complete, trusted HTTPS SSL certificate chain (Viber rejects self-signed or incomplete intermediate certs during
set_webhook). - Enable AI Auto-Reply or Automation Rules to greet Viber inquiries outside business hours while enforcing per-conversation cooldown limits.
- For multiple Viber bots on one Perfex installation, append
?account_id=YOUR_BOT_URIto the webhook URL passed toset_webhook.
Common Pitfalls and Quick Fixes
- set_webhook fails with SSL or certificate error: Verify your TLS chain with an SSL checker and install any missing intermediate CA bundle on Apache or Nginx.
- Webhook POSTs rejected with 403 Invalid signature: Confirm you pasted the exact Viber Bot Auth Token into both Token and App Secret fields in Perfex OmniChat Settings.
- Bot fails to trigger webhook on conversation start: Make sure
"message"is included in theevent_typesarray when callingset_webhook, asPoly_omnichat_viber_adapteringestsevent === "message"events.
Frequently Asked Questions
Why do I enter the Viber Auth Token in both Token and App Secret?
Unlike Meta apps that issue separate tokens and secrets, Viber uses your Bot Auth Token both to authenticate outbound send_message API calls and as the HMAC-SHA256 signing key for X-Viber-Content-Signature on inbound webhooks, so both Perfex fields share that value.
Does PolyUtilities verify Viber webhook authenticity automatically?
Yes. Every POST request arriving at poly_utilities/omnichat/webhook/viber is hashed via hash_hmac('sha256', raw_body, auth_token) and compared against the incoming X-Viber-Content-Signature header using timing-safe hash_equals(). Any forged or mismatched webhook request returns HTTP 403 immediately before touching any Perfex CRM conversation table.
Are Viber inbound images and files downloaded safely to Perfex?
Yes. Media URLs originating from allowlisted dl-media.viber.com and .viber.com hosts are fetched over HTTPS with SSRF public-IP validation and sanitized through the 10-layer file security pipeline and GD Image CDR checks before appearing safely inside your Perfex CRM Unified Inbox.
Can I reply from Perfex CRM using AI Copilot and canned responses?
Yes. Support agents can type / for slash canned responses, click AI Draft, Rewrite, or Custom Translate on any active Viber conversation, and dispatch outbound replies directly through https://chatapi.viber.com/pa/send_message without ever leaving your active Perfex CRM Unified Inbox workspace.

Leave a Reply