1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-16 11:38:11 +02:00
OpenIntegrations/docs/en/md/Viber/Message-sending/Send-link.md

53 lines
1.2 KiB
Markdown
Raw Normal View History

---
sidebar_position: 6
---
# Send link
Sends a URL with a preview to a chat or channel
2024-07-10 12:58:29 +02:00
`Function SendLink(Val Token, Val URL, Val UserID, Val SendingToChannel) Export`
| Parameter | CLI option | Type | Destination |
|-|-|-|-|
| Token | --token | String | Token |
| URL | --url | String | SentLink |
| UserID | --user | String, Number | User ID. For channel > administrator, for bot > recipient |
| SendingToChannel | --ischannel | Boolean | Sending to channel or bot chat |
Returns: Map Of KeyAndValue - serialized JSON response from Viber
2024-07-10 13:05:58 +02:00
<br/>
2024-07-10 12:58:29 +02:00
```bsl title="Code example"
2024-07-10 13:24:11 +02:00
BotToken = "523b5b25ed27e6ec-111111111111111-2222222222222222";
UserID = "d3jxe1111111111jYGgZg==";
Response = OPI_Viber.SendLink(BotToken, "https://github.com/Bayselonarrend", UserID, False); //Map
Response = OPI_Tools.JSONString(Response); //JSON string
```
```sh title="CLI command example"
oint viber SendLink --token %token% --url %url% --user "d3jxe1111111111jYGgZg" --ischannel %ischannel%
```
```json title="Result"
2024-07-10 13:11:17 +02:00
{
"billing_status": 1,
"chat_hostname": "SN-CHAT-15_",
"message_token": 5925752472607291800,
"status_message": "ok",
"status": 0
}
```