1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-05-31 23:20:02 +02:00
OpenIntegrations/docs/en/md/Twitter/Tweets/Upload-attachments-array.mdx

51 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-10-15 10:16:04 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
---
2024-10-13 01:21:47 +03:00
sidebar_position: 7
---
# 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 | Description |
|-|-|-|-|
| ArrayOfFiles | --files | Array of String, BinaryData | Array of files to be uploaded |
| AttachmentsType | --type | String | Attachment type: tweet_video, tweet_image, tweet_gif |
| Parameters | --auth | Structure Of String | Authorization data. See GetStandardParameters |
Returns: Array Of String - Media ID array
<br/>
```bsl title="Code example"
Parameters = GetTwitterAuthData();
2024-10-15 10:07:27 +03:00
Image1 = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Binary Data or Path to file
Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary Data or Path to file
2024-10-13 01:21:47 +03:00
ImageArray = New Array();
ImageArray.Add(Image1);
ImageArray.Add(Image2);
Result = OPI_Twitter.UploadAttachmentsArray(ImageArray, "tweet_image", Parameters);
```
2024-10-15 09:53:37 +03:00
2024-10-13 01:21:47 +03:00
```json title="Result"
[
"1843891479330058240",
"1843891499429142528"
]
```