1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-21 01:50:24 +02:00
OpenIntegrations/docs/en/md/Twitter/Tweets/Create-poll-tweet.md
2024-06-05 13:35:05 +03:00

57 lines
1.3 KiB
Markdown

---
sidebar_position: 5
---
# Create poll tweet
Creates a tweet with a poll
*Function CreatePollTweet(Val Text, Val OptionArray, Val Duration, Val Parameters = "") ExportReturn CreateCustomTweet(Text,, OptionArray, Duration, Parameters);EndFunction*
| Parameter | CLI option | Type | Destination |
|-|-|-|-|
| 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 JSON or path to .json |
Returns: Key-Value Pair - serialized JSON response from Twitter
```bsl title="Code example"
OptionArray = New Array;
OptionArray.Add("Good");
OptionArray.Add("Nothing special");
OptionArray.Add("Bad");
Response = OPI_Twitter.CreatePollTweet("How are you?", OptionArray, 60, Parameters);
Response = OPI_Tools.JSONString(Response);
```
```sh title="CLI command example"
oint twitter CreatePollTweet --text %text% --options %options% --duration %duration% --auth %auth%
```
```json title="Result"
{
"data": {
"text": "How are you?",
"id": "1746082302268969388",
"edit_history_tweet_ids": [
"1746082302268969388"
]
}
}
```