Skip to main content

Upload photo to server

Uploads photo to server for further use

Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post") Export

ParameterCLI optionTypeRequiredDescription
Image--fileString, BinaryDataImage file
Parameters--authStructure Of StringAuthorization parameters. See GetAuthParameters
View--typeStringUpload type (Post, Product, Story, Poll, Other)
Returns

Map Of KeyAndValue - serialized JSON response from VK

tip

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
Parameters = GetVKParameters();

Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Binary data or File path
View = "Post";

Result = OPI_VK.UploadPhotoToServer(Image, Parameters, View);
# JSON data can also be passed as a path to a .json file

oint vk UploadPhotoToServer \
--file "https://hut.openintegrations.dev/test_data/picture.jpg" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}" \
--type "Post"
Result
{
"response": [
{
"album_id": -14,
"date": 1779802140,
"id": 457250551,
"owner_id": 657846756,
"access_key": "***",
"sizes": [
{
"height": 54,
"type": "s",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 120,
"type": "m",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 480,
"type": "x",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 810,
"type": "y",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 960,
"type": "z",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 1920,
"type": "w",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 81,
"type": "o",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 180,
"type": "p",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 270,
"type": "q",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 405,
"type": "r",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 1920,
"type": "base",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
}
],
"text": "",
"web_view_token": "***",
"has_tags": false,
"orig_photo": {
"height": 1920,
"type": "base",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN...",
"width": "***"
}
}
]
}