2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 5
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create poll tweet
|
|
|
|
Creates a tweet with a poll
|
|
|
|
|
|
|
|
|
2024-06-07 08:47:43 +02:00
|
|
|
*Function CreatePollTweet(Val Text, Val OptionArray, Val Duration, Val Parameters = "") Export*
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| 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 |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```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"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|