Save image to album
Saves an image to the community album
- Parameters
- Advanced call ?
Function SaveImageToAlbum(Val AlbumID, Val Image, Val Description = "", Val Parameters = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| AlbumID | --album | String, Number | ✔ | Album ID |
| Image | --picture | BinaryData, String | ✔ | Image file |
| Description | --description | String | ✖ | Image description |
| Parameters | --auth | Structure Of String | ✖ | Authorization parameters. See GetAuthParameters |
Returns
Map Of KeyAndValue - serialized JSON response from VK
| 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) |
tip
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
Parameters = GetVKParameters();
ImageDescription = "AutoTestImage";
AlbumID = "310586206";
Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, File path or Binary data
Result = OPI_VK.SaveImageToAlbum(AlbumID, Image, ImageDescription, Parameters);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint vk SaveImageToAlbum \
--album 312639606 \
--picture "https://hut.openintegrations.dev/test_data/picture.jpg" \
--description "AutoTestImage" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
:: JSON data can also be passed as a path to a .json file
oint vk SaveImageToAlbum ^
--album 312639606 ^
--picture "https://hut.openintegrations.dev/test_data/picture.jpg" ^
--description "AutoTestImage" ^
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": [
{
"album_id": 312639606,
"date": 1779802127,
"id": 457264593,
"owner_id": -218861756,
"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": "AutoTestImage",
"user_id": 100,
"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": "***"
}
}
]
}