1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-07 23:03:08 +02:00
Files
OpenIntegrations/docs/en/md/Viber/Settings-and-information/Set-webhook.mdx

45 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 1
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# 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`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Viber Token |
| URL | --url | String | ✔ | URL for setting up Webhook |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Viber
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Token = "523b58ba82afffaa-7ef3b426...";
URL = "http://api.athenaeum.digital/hs/viber";
Result = OPI_Viber.SetWebhook(Token, URL);
```
```json title="Result"
{
"status": 1,
"status_message": "URL not valid or not HTTPS",
"chat_hostname": "SN-CHAT-03_"
}
```