---
sidebar_position: 7
description: Create story and other functions to work with VK in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, VK]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create story
 Creates a story from an image



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

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Image | --picture | String, BinaryData | &#x2714; | Story background |
  | URL | --url | String | &#x2716; | URL for button under the story |
  | Parameters | --auth | Structure Of String | &#x2716; | Authorization 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
:::
<br/>


```bsl title="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);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint vk CreateStory \
             --picture "/tmp/c2eqgi5p.shh.png" \
             --auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint vk CreateStory ^
             --picture "/tmp/c2eqgi5p.shh.png" ^
             --auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "response": {
  "count": 1,
  "items": [
   {
    "id": 456241295,
    "owner_id": -218861756,
    "access_key": "***",
    "can_comment": 1,
    "can_reply": 1,
    "can_see": 1,
    "can_like": true,
    "can_share": 1,
    "can_hide": 1,
    "date": 1765390853,
    "expires_at": 1765477253,
    "link": {
     "text": "Ещё",
     "url": "https://github.com/Bayselonarrend/OpenIntegrations"
    },
    "photo": {
     "album_id": -81,
     "date": 1765390853,
     "id": 457261184,
     "owner_id": -218861756,
     "sizes": [
      {
       "height": 453,
       "type": "x",
       "width": "***",
       "url": "https://sun56-1.userapi.com/s/v1/ig2/P0LiFiZJj6XLvHvfndDxkV4w2HEVrfdR5L9NZW9JPbyymP1goO6CIzslpmL8xRdNC4KlAQpbYCzrLwaTEw1S8FaW.jpg?size=604x453&quality=95&type=story"
      },
      {
       "height": 605,
       "type": "y",
       "width": "***",
       "url": "https://sun56-1.userapi.com/s/v1/ig2/GNB6HtelXyXaFwLleLpkgWs9-CJzrqxMbZAKgWkaXSRmHHVd52ei-RSOLTxvIS5d2GvS0PvwYPaNXSlVo0g8GvwQ.jpg?size=807x605&quality=95&type=story"
      },
      {
       "height": 960,
       "type": "z",
       "width": "***",
       "url": "https://sun56-1.userapi.com/s/v1/ig2/Mk6ojBWP5WOHamyZvIKGh1lr5SRMAitHeX_U_gkpMENOHtDGXMn1jxuVWeFl_kY5LpCaGDx-lIEGMrjVkNXzabjD.jpg?size=1280x960&quality=95&type=story"
      },
      {
       "height": 1920,
       "type": "w",
       "width": "***",
       "url": "https://sun56-1.userapi.com/s/v1/ig2/QfaB7f694iiZLsUfeRayXMu1SKNw5noEXc7-yyUn4soMCoz25eFEhzzBl8AkQz374obSEy2VoLR9Ohv7uqx990q9.jpg?size=2560x1920&quality=95&type=story"
      }
     ],
     "text": "",
     "user_id": 100,
     "web_view_token": "***",
     "has_tags": false
    },
    "replies": {
     "count": 0,
     "new": 0
    },
    "track_code": "story_json/eyJvd25lcl9pZCI6LTIxODg2MTc1Niwic3RvcnlfaWQiOjQ1NjI0MTI5NSwidmlld2VyX2lkIjo2NTc4NDY3NTZ9",
    "type": "photo",
    "views": 0,
    "likes_count": 0,
    "reaction_set_id": "reactions",
    "no_sound": false,
    "can_ask": 0,
    "can_ask_anonymous": 0,
    "narratives_count": 0,
    "can_use_in_narrative": true
   }
  ]
 }
}
```
