1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-16 11:38:11 +02:00
OpenIntegrations/docs/en/md/Viber/Settings-and-information/Set-webhook.md
2024-06-04 21:55:01 +03:00

1.3 KiB

sidebar_position
1

Set Webhook

IMPORTANT: Setting up Webhook is mandatory according to Viber rules. You need to have a free URL for this., which will return 200 and a genuine SSL certificate. If there is a certificate and the database is published on the server - you can use an HTTP service. Information about new messages will also be sent there Viber periodically knocks on the Webhook address, so if it is inactive, everything will stop working

Function SetWebhook(Val Token, Val URL) Export

Parameter CLI option Type Destination
Token --token String Viber Token
URL --url String URL for setting up Webhook

Returns: Key-Value Pair - serialized JSON response from Viber

	
 
 Response = OPI_Viber.SetWebhook(Token, "https://api.athenaeum.digital/opi/hs/viber"); //Map
 Response = OPI_Tools.JSONString(Response); //JSON string
 

	
 
 oint viber SetWebhook --token %token% --url %url%


{
 "event_types": [
 "subscribed",
 "unsubscribed",
 "webhook",
 "conversation_started",
 "client_status",
 "action",
 "delivered",
 "failed",
 "message",
 "seen"
 ],
 "chat_hostname": "SN-CHAT-12_",
 "status_message": "ok",
 "status": 0
 }