| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							|  |  |  |  | Parameter | CLI option | Type | Destination | | 
					
						
							|  |  |  |  |-|-|-|-| | 
					
						
							|  |  |  |  | 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 | | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |  Returns: Map Of KeyAndValue - Serialized JSON response from VK | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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-07-10 14:24:11 +03:00
										 |  |  |  Parameters = GetVKParameters(); | 
					
						
							| 
									
										
										
										
											2024-06-07 11:53:24 +00:00
										 |  |  |  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-07-10 11:59:55 +03:00
										 |  |  | 	 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 11:53:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ```sh title="CLI command example" | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |  oint vk CreatePoll --question "What's your favorite color?" --options "['Red','Yellow','Green']" --picture %picture% --auth %auth% | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```json title="Result" | 
					
						
							| 
									
										
										
										
											2024-07-10 14:11:17 +03:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2024-06-07 11:53:24 +00:00
										 |  |  |  "response": { | 
					
						
							|  |  |  |  "post_id": 2127 | 
					
						
							|  |  |  |  } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ``` |