2024-06-07 11:53:24 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 4
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create poll
|
|
|
|
Creates a poll with answer options
|
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function CreatePoll(Val Question, Val AnswersArray, Val Image = "", Val Parameters = "") Export`
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Question | --question | String | Poll question |
|
|
|
|
| AnswersArray | --options | Array of String | Array of answer options |
|
|
|
|
| Image | --picture | String, BinaryData | Poll image |
|
|
|
|
| Parameters | --auth | Structure Of String | Authorization JSON or path to .json |
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-10-09 09:42:00 +03:00
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from VK
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-07-10 14:05:58 +03:00
|
|
|
<br/>
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-07 11:53:24 +00:00
|
|
|
```bsl title="Code example"
|
2024-08-13 16:47:32 +03:00
|
|
|
Parameters = GetVKParameters();
|
|
|
|
Question = "What's your favorite color?";
|
|
|
|
|
|
|
|
OptionArray = New Array;
|
|
|
|
OptionArray.Add("Red");
|
|
|
|
OptionArray.Add("Yellow");
|
|
|
|
OptionArray.Add("Green");
|
|
|
|
|
|
|
|
Result = OPI_VK.CreatePoll(Question, OptionArray, , Parameters);
|
2024-06-07 11:53:24 +00:00
|
|
|
```
|
2024-10-15 09:53:37 +03:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-07 11:53:24 +00:00
|
|
|
|
|
|
|
```json title="Result"
|
2024-08-14 09:06:31 +03:00
|
|
|
{
|
2024-10-06 16:55:08 +03:00
|
|
|
"response": {
|
2024-10-09 09:42:00 +03:00
|
|
|
"post_id": 4556
|
2024-10-06 16:55:08 +03:00
|
|
|
}
|
|
|
|
}
|
2024-06-07 11:53:24 +00:00
|
|
|
```
|