Skip to main content

Create video tweet

Creates a tweet with a video attachment

Function CreateVideoTweet(Val Text, Val VideosArray, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
Text--textStringTweet text
VideosArray--videosArray of String, BinaryDataVideo 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);

Video = "https://hut.openintegrations.dev/test_data/video.mp4"; // URL, Binary or File path
Video2 = "https://hut.openintegrations.dev/test_data/video.mp4"; // URL, Binary or File path

VideosArray = New Array;
VideosArray.Add(Video);
VideosArray.Add(Video2);

Result = OPI_Twitter.CreateVideoTweet(Text, VideosArray, Parameters);

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

oint twitter CreateVideoTweet \
--text "TestTweet63445575-919a-404c-84ad-dad03668d5b3" \
--videos "C:\Users\bayse\AppData\Local\Temp\3ulsfhjv.gjh" \
--auth "{'redirect_uri':'https://hut.openintegrations.dev/melezh/6ad91cc8b','client_id':'***','client_secret':'***','access_token':'***','refresh_token':'***','oauth_token':'***','oauth_token_secret':'***','oauth_consumer_key':'***','oauth_consumer_secret':'***'}"
Result
{
"data": {
"id": "1976383410772791478",
"edit_history_tweet_ids": [
"1976383410772791478"
],
"text": "TestTweet9033e9c3-7700-444c-8348-e13df18ff255 https://t.co/gFvWX6Cy6R"
}
}