Create poll tweet
Creates a tweet with a poll
Function CreatePollTweet(Val Text, Val OptionArray, Val Duration, Val Parameters = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Text | --text | String | ✔ | Tweet text |
| OptionArray | --options | Array of String | ✔ | Poll options array |
| Duration | --duration | String, Number | ✔ | Poll duration |
| Parameters | --auth | Structure Of String | ✖ | Authorization data. See GetStandardParameters |
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
1C:Enterprise/OneScript code example
Parameters = GetTwitterAuthData();
Text = "TestTweet" + String(New UUID);
AnswersArray = New Array;
AnswersArray.Add("Option 1");
AnswersArray.Add("Option 2");
Result = OPI_Twitter.CreatePollTweet(Text, AnswersArray, 60, Parameters);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint twitter CreatePollTweet \
--text "TestTweetaf4a097e-e865-4e99-9eaa-9484d4103340" \
--options "['Option 1','Option 2']" \
--duration 60 \
--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 CreatePollTweet ^
--text "TestTweetaf4a097e-e865-4e99-9eaa-9484d4103340" ^
--options "['Option 1','Option 2']" ^
--duration 60 ^
--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": {
"text": "TestTweet49115b6f-bf0d-44ff-9e3b-298962be2427",
"edit_history_tweet_ids": [
"1976383918543671637"
],
"id": "1976383918543671637"
}
}