Skip to main content

Create story

Creates a story from an image

Function CreateStory(Val Image, Val URL = "", Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
Image--pictureString, BinaryDataStory background
URL--urlStringURL for button under the story
Parameters--authStructure Of StringAuthorization parameters. See GetAuthParameters
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();
URL = "https://github.com/Bayselonarrend/OpenIntegrations";

Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, File path or Binary data
TFN = GetTempFileName("png");
CopyFile(Image, TFN);
Image = New BinaryData(TFN);

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

oint vk CreateStory \
--picture "/tmp/tgq5ymcf.vwt.png" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": {
"count": 1,
"items": [
{
"id": 456241641,
"owner_id": -218861756,
"access_key": "***",
"can_comment": 1,
"can_reply": 1,
"can_see": 1,
"can_like": true,
"can_share": 1,
"can_hide": 1,
"date": 1779802146,
"answers_count": 0,
"expires_at": 1779888546,
"link": {
"text": "Ещё",
"url": "https://github.com/Bayselonarrend/OpenIntegrations"
},
"photo": {
"album_id": -81,
"date": 1779802146,
"id": 457264594,
"owner_id": -218861756,
"sizes": [
{
"height": 453,
"type": "x",
"width": "***",
"url": "https://sun9-73.userapi.com/s/v1/ig2/fsn8tbXCKXYsdeBw8yx61LN7dNGvE3k1P7AQH2Jtbnk7g1TFpaYhbNky8-a8Wmh..."
},
{
"height": 605,
"type": "y",
"width": "***",
"url": "https://sun9-73.userapi.com/s/v1/ig2/IvIKVLlBBWmoTw0mjgsjFv16p0-uDHOOs04wmhsoX_m2uty6hzwvzbGSEJX8EQN..."
},
{
"height": 960,
"type": "z",
"width": "***",
"url": "https://sun9-73.userapi.com/s/v1/ig2/FdLSG2yz1HRSL30qJ_Ef8HTsP7q1Ay5rkc7ALMVOsl6AwS0k4bhTyafBsZBeolL..."
},
{
"height": 1920,
"type": "w",
"width": "***",
"url": "https://sun9-73.userapi.com/s/v1/ig2/o4qlGGXj6OmeJyH7w6MSCHxXPaww60fJrE6MequielvhugVoxCXl_q20ZfnWFGm..."
}
],
"text": "",
"user_id": 100,
"web_view_token": "***",
"has_tags": false
},
"replies": {
"count": 0,
"new": 0
},
"track_code": "story_json/eyJvd25lcl9pZCI6LTIxODg2MTc1Niwic3RvcnlfaWQiOjQ1NjI0MTY0MSwidmlld2VyX2lkIjo2NTc4NDY3NTZ9",
"type": "photo",
"views": 0,
"likes_count": 0,
"reaction_set_id": "story_reactions",
"no_sound": false,
"can_ask": 0,
"can_ask_anonymous": 0,
"narratives_count": 0,
"can_use_in_narrative": true
}
]
}
}