1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-06-02 23:27:50 +02:00
2024-10-22 08:59:24 +03:00

63 lines
1.6 KiB
Plaintext
Vendored

---
sidebar_position: 1
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# 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 | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Viber Token |
| URL | --url | String | ✔ | URL for setting up Webhook |
Returns: Map Of KeyAndValue - serialized JSON response from Viber
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "523b58ba82afffaa-7ef3b426...";
URL = "http://api.athenaeum.digital/hs/viber";
Result = OPI_Viber.SetWebhook(Token, URL);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint viber SetWebhook \
--token "***" \
--url "http://api.athenaeum.digital/hs/viber"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint viber SetWebhook ^
--token "***" ^
--url "http://api.athenaeum.digital/hs/viber"
```
</TabItem>
</Tabs>
```json title="Result"
{
"status": 1,
"status_message": "URL not valid or not HTTPS",
"chat_hostname": "SN-CHAT-03_"
}
```