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-image.md

54 lines
1.3 KiB
Markdown
Raw Normal View History

---
sidebar_position: 2
---
# Send image
Sends an image to a chat or channel
<br/>
2024-07-10 12:58:29 +02:00
`Function SendImage(Val Token, Val URL, Val UserID, Val SendingToChannel, Val Description = "") Export`
| Parameter | CLI option | Type | Destination |
|-|-|-|-|
| Token | --token | String | Token |
| URL | --picture | String | Image URL |
| UserID | --user | String, Number | User ID. For channel > administrator, for bot > recipient |
| SendingToChannel | --ischannel | boolean | Sending to channel or bot chat |
| Description | --description | String | Image annotation |
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:11:17 +02:00
ChannelToken = "523b58ba82afffaa-111111111111111-2222222222222222";
UserID = "tMNGh111111111D+bT4g==";
Response = OPI_Viber.SendImage(ChannelToken, "https://api.athenaeum.digital/logo.png", UserID, True, "Alpaca"); //Map
Response = OPI_Tools.JSONString(Response); //JSON string
```
```sh title="CLI command example"
oint viber SendImage --token %token% --picture %picture% --user "tMNGh111111111D+bT4g" --ischannel %ischannel% --description %description%
```
```json title="Result"
2024-07-10 13:11:17 +02:00
{
"chat_hostname": "SN-CHAT-12_",
"message_token": 5925484936191962157,
"status_message": "ok",
"status": 0
}
```