1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Twitter/Tweets/Create-image-tweet.mdx
T
Vitaly the Alpaca (bot) 20c8a991c5 Main build (Jenkins)
2024-10-15 13:51:58 +03:00

63 lines
1.5 KiB
Plaintext

---
sidebar_position: 3
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Create image tweet
Creates a tweet with an image attachment
`Function CreateImageTweet(Val Text, Val ImageArray, Val Parameters = "") Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Text | --text | String | Tweet text |
| ImageArray | --pictures | Array of String, BinaryData | Image files array |
| Parameters | --auth | Structure Of String | Authorization data. See GetStandardParameters |
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
<br/>
:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="Code example"
Parameters = GetTwitterAuthData();
Text = "TestTweet" + String(New UUID);
Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Binary or Path to file
Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary or Path to file
ImageArray = New Array;
ImageArray.Add(Image);
ImageArray.Add(Image2);
Result = OPI_Twitter.CreateImageTweet(Text, ImageArray, Parameters);
Text = "TestTweet" + String(New UUID);
Result = OPI_Twitter.CreateImageTweet(Text, Image, Parameters);
```
```json title="Result"
{
"data": {
"id": "1843891880246775903",
"edit_history_tweet_ids": [
"1843891880246775903"
],
"text": "TestTweet451aa501-9a10-4e00-bcc5-0c3c8d61221a https://t.co/VWvjWsdQHs"
}
}
```