Skip to main content

Create gif tweet

Creates a tweet with a gif attachment

Function CreateGifTweet(Val Text, Val GifsArray, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
Text--textStringTweet text
GifsArray--gifsArray of String, BinaryDataGif files array
Parameters--authStructure Of StringAuthorization data. See GetStandardParameters

Returns: Map Of KeyAndValue - serialized JSON response from Twitter


tip

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
    Parameters = GetTwitterAuthData();
Text = "TestTweet" + String(New UUID);

GIF = "https://api.athenaeum.digital/test_data/animation.gif"; // URL, Binary or Path to file
Gif2 = "https://api.athenaeum.digital/test_data/animation.gif"; // URL, Binary or Path to file

GifsArray = New Array;
GifsArray.Add(GIF);
GifsArray.Add(Gif2);

Result = OPI_Twitter.CreateGifTweet(Text, GifsArray, Parameters);

Text = "TestTweet" + String(New UUID);
Result = OPI_Twitter.CreateGifTweet(Text, GIF, Parameters);
    # JSON data can also be passed as a path to a .json file

oint twitter CreateGifTweet \
--text "TestTweetcccfb32a-8a1c-49bf-a35b-f3c41a3453d6" \
--gifs "C:\Users\Administrator\AppData\Local\Temp\njmohx1frez.tmp" \
--auth "{'redirect_uri':'https://api.athenaeum.digital/opi/hs/twitter','client_id':'***','client_secret':'***','access_token':'***','refresh_token':'***','oauth_token':'***','oauth_token_secret':'***','oauth_consumer_key':'***','oauth_consumer_secret':'***'}"
Result
{
"data": {
"text": "TestTweet27989425-2fb9-4d49-ac50-2b73dff7c69e https://t.co/m6q4Bzxea3",
"id": "1843892227023507612",
"edit_history_tweet_ids": [
"1843892227023507612"
]
}
}