Skip to main content

Send image

Sends an image to a chat or channel

Function SendImage(Val Token, Val URL, Val UserID, Val SendingToChannel, Val Description = "") Export

ParameterCLI optionTypeDescription
Token--tokenStringToken
URL--pictureStringImage URL
UserID--userString, NumberUser ID. For channel > administrator, for bot > recipient
SendingToChannel--ischannelbooleanSending to channel or bot chat
Description--descriptionStringImage annotation

Returns: Map Of KeyAndValue - serialized JSON response from Viber


Code example
  
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
CLI command example
    
oint viber SendImage --token %token% --picture %picture% --user "tMNGh111111111D+bT4g" --ischannel %ischannel% --description %description%

Result
{
"chat_hostname": "SN-CHAT-12_",
"message_token": 5925484936191962157,
"status_message": "ok",
"status": 0
}