---
sidebar_position: 7
description: Upload attachments array and other functions to work with Twitter 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, Twitter]
---

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

# Upload attachments array
 Uploads files to the server and returns their IDs



`Function UploadAttachmentsArray(Val ArrayOfFiles, Val AttachmentsType, Val Parameters = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | ArrayOfFiles | --files | Array of String, BinaryData | &#x2714; | Array of files to be uploaded |
  | AttachmentsType | --type | String | &#x2714; | Attachment type: tweet_video, tweet_image, tweet_gif |
  | Parameters | --auth | Structure Of String | &#x2716; | Authorization data. See GetStandardParameters |

  
  Returns:  Array Of String - Media ID array

:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Parameters = GetTwitterAuthData();

    Image1 = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Binary Data or File path
    Image2 = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Binary Data or File path

    ImageArray = New Array;
    ImageArray.Add(Image1);
    ImageArray.Add(Image2);

    Result = OPI_Twitter.UploadAttachmentsArray(ImageArray, "tweet_image", Parameters);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint twitter UploadAttachmentsArray \
             --files "['https://hut.openintegrations.dev/test_data/picture.jpg','https://hut.openintegrations.dev/test_data/picture2.jpg']" \
             --type "tweet_image" \
             --auth "{'redirect_uri':'https://hut.openintegrations.dev/melezh/6ad91cc8b','client_id':'***','client_secret':'***','access_token':'***','refresh_token':'***','oauth_token':'***','oauth_token_secret':'***','oauth_consumer_key':'***','oauth_consumer_secret':'***'}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint twitter UploadAttachmentsArray ^
             --files "['https://hut.openintegrations.dev/test_data/picture.jpg','https://hut.openintegrations.dev/test_data/picture2.jpg']" ^
             --type "tweet_image" ^
             --auth "{'redirect_uri':'https://hut.openintegrations.dev/melezh/6ad91cc8b','client_id':'***','client_secret':'***','access_token':'***','refresh_token':'***','oauth_token':'***','oauth_token_secret':'***','oauth_consumer_key':'***','oauth_consumer_secret':'***'}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
[
 "1998821823014711296",
 "1998821835706662913"
]
```
