Skip to main content

Create image tweet

Creates a tweet with an image attachment

Function CreateImageTweet(Val Text, Val ImageArray, Val Parameters = "") Export

ParameterCLI optionTypeDescription
Text--textStringTweet text
ImageArray--picturesArray of String, BinaryDataImage files array
Parameters--authStructure Of StringAuthorization JSON or path to .json

Returns: Map Of KeyAndValue - serialized JSON response from Twitter


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);
CLI command example
    
oint twitter CreateImageTweet --text %text% --pictures %pictures% --auth %auth%

Result
{
"data": {
"text": "Alpaca https://t.co/OodoWT1AAA",
"id": "1745753004542726629",
"edit_history_tweet_ids": [
"1745753004542726629"
]
}
}