2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create image tweet
|
|
|
|
Creates a tweet with an image attachment
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
*Function CreateImageTweet(Val Text, Val ImageArray, Val Parameters = "") Export*
|
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Text | --text | String | Tweet text |
|
|
|
|
| ImageArray | --pictures | Array of String, BinaryData | Image files array |
|
|
|
|
| Parameters | --auth | Structure Of String | Authorization JSON or path to .json |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
|
|
|
|
|
|
|
ImageArray = New Array;
|
|
|
|
ImageArray.Add("C:\logo.png");
|
|
|
|
ImageArray.Add("C:\logo_long.png");
|
|
|
|
|
|
|
|
Response = OPI_Twitter.CreateImageTweet("Alpaca", ImageArray, Parameters);
|
|
|
|
Response = OPI_Tools.JSONString(Response);
|
|
|
|
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint twitter CreateImageTweet --text %text% --pictures %pictures% --auth %auth%
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 10:59:55 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"data": {
|
|
|
|
"text": "Alpaca https://t.co/OodoWT1AAA",
|
|
|
|
"id": "1745753004542726629",
|
|
|
|
"edit_history_tweet_ids": [
|
|
|
|
"1745753004542726629"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|