Create image tweet
Creates a tweet with an image attachment
Function CreateImageTweet(Val Text, Val ImageArray, Val Parameters = "") Export
| Parameter | CLI option | Type | Required | 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
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);
    Image  = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Binary or File path
    Image2 = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Binary or File path
    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);
- Bash
 - CMD/Bat
 
    # JSON data can also be passed as a path to a .json file
    
    oint twitter CreateImageTweet \
     --text "TestTweet31d51531-cd01-4fce-b09f-7ad7342520ef" \
     --pictures "/tmp/rzznwp0d.fqs" \
     --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':'***'}"
    :: JSON data can also be passed as a path to a .json file
    
    oint twitter CreateImageTweet ^
     --text "TestTweet31d51531-cd01-4fce-b09f-7ad7342520ef" ^
     --pictures "/tmp/rzznwp0d.fqs" ^
     --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
{
 "title": "Too Many Requests",
 "detail": "Too Many Requests",
 "type": "about:blank",
 "status": 429
}