Set Webhook
Sets a webhook to receive messages
- Parameters
- Advanced call ?
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
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Token = "523b58ba82afffaa-7ef3b426...";
URL = "http://api.athenaeum.digital/hs/viber";
Result = OPI_Viber.SetWebhook(Token, URL);
- Bash
- CMD/Bat
oint viber SetWebhook \
--token "***" \
--url "http://api.athenaeum.digital/hs/viber"
oint viber SetWebhook ^
--token "***" ^
--url "http://api.athenaeum.digital/hs/viber"
Result
{
"status": 1,
"status_message": "URL not valid or not HTTPS",
"chat_hostname": "SN-CHAT-03_"
}