Documentation for using the API's POST method to create a new poll. Learn to correctly structure the request payload to associate the new poll with a specific user profile, group, or business page container on the OSSN platform.
Endpoint
Method:
Parameter:
| Parameter name | Required | Type | Explain |
|---|---|---|---|
| api_key_token | Yes | string | Your API key |
| title | Yes | string | Event title |
| counter | Yes | string | Number of poll options minimim 2 |
| poll_options_1 | Yes | string | Option one |
| poll_options_2 | Yes | string | Option two |
| poll_option.. | Yes | string | Option N |
| container_type | Yes | string | user or group |
| container_guid | Yes | integer | Guid for container where events belongs (user guid or group guid) |
| uguid | Yes | integer | Loggedin user Guid |
** Information**
poll_options_n is based on counter if you have counter 3 that means three options are expected
poll_options_1 poll_options_2 and poll_options_3 need to be supplied.
Example Response
{
"merchant": "Premium Social Network",
"url": "http:\/\/local.openteknik.com\/",
"time_token": 1632158400,
"payload": {
"poll": {
"data": {},
"guid": 119,
"time_created": 1632158399,
"owner_guid": 1,
"description": "{\"9f723546399fd15446af2331f7cb8258\":\"option 1\",\"fbeee6bcd14a108e9201ea9041ec96ae\":\"Option 3\"}",
"title": "Some title",
"type": "user",
"subtype": "poll:item",
"container_guid": "1",
"container_type": "user",
"is_ended": "",
"poll_entity": "687"
}
},
"code": "100",
"message": "Request successfully executed"
}
Return payload parameter description
| Parameter name | Explain |
|---|---|
| poll | Newly created poll |
| descrtipion | JSON poll options |