Create story
Creates a story from an image
- Parameters
- Advanced call ?
Function CreateStory(Val Image, Val URL = "", Val Parameters = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Image | --picture | String, BinaryData | ✔ | Story background |
| URL | --url | String | ✖ | URL for button under the story |
| 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();
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);
- Bash
- CMD/Bat
# 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'}"
:: 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
}
]
}
}