Download OpenAPI specification:Download
Welcome to the HumHub polls module API reference.
page | string >= 0 The number of page of the result set. |
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page. |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 4,
- "contentcontainer_id": 2,
- "question": "Poll question from API?",
- "description": "Poll description from API",
- "allow_multiple": 1,
- "created_at": "2021-07-20 09:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 09:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "is_random": 1,
- "closed": 1,
- "anonymous": 0,
- "show_result_after_close": 0,
- "answers": [
- {
- "id": 1,
- "poll_id": 4,
- "answer": "First answer text",
- "created_at": "2021-07-20 10:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 10:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}
}
], - "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
]
}
id required | integer ID of content container |
page | string >= 0 The number of page of the result set. |
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page. |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 4,
- "contentcontainer_id": 2,
- "question": "Poll question from API?",
- "description": "Poll description from API",
- "allow_multiple": 1,
- "created_at": "2021-07-20 09:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 09:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "is_random": 1,
- "closed": 1,
- "anonymous": 0,
- "show_result_after_close": 0,
- "answers": [
- {
- "id": 1,
- "poll_id": 4,
- "answer": "First answer text",
- "created_at": "2021-07-20 10:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 10:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}
}
], - "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
]
}
id required | integer The id of content container |
Poll information
required | object |
newAnswers required | Array of strings New answers |
object (Content) |
{- "Poll": {
- "question": "New question from API?",
- "description": "New description from API?",
- "allow_multiple": 0,
- "is_random": 1,
- "anonymous": 0,
- "show_result_after_close": 0
}, - "newAnswers": [
- "First answer",
- "Second answer",
- "Third answer"
], - "content": {
- "metadata": {
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false
}, - "topics": [
- {
- "name": "News"
}
]
}
}
{- "id": 4,
- "contentcontainer_id": 2,
- "question": "Poll question from API?",
- "description": "Poll description from API",
- "allow_multiple": 1,
- "created_at": "2021-07-20 09:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 09:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "is_random": 1,
- "closed": 1,
- "anonymous": 0,
- "show_result_after_close": 0,
- "answers": [
- {
- "id": 1,
- "poll_id": 4,
- "answer": "First answer text",
- "created_at": "2021-07-20 10:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 10:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}
}
], - "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
{- "id": 4,
- "contentcontainer_id": 2,
- "question": "Poll question from API?",
- "description": "Poll description from API",
- "allow_multiple": 1,
- "created_at": "2021-07-20 09:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 09:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "is_random": 1,
- "closed": 1,
- "anonymous": 0,
- "show_result_after_close": 0,
- "answers": [
- {
- "id": 1,
- "poll_id": 4,
- "answer": "First answer text",
- "created_at": "2021-07-20 10:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 10:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}
}
], - "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
id required | integer The id of the poll |
Poll information
required | object |
answers | Array of strings Updating answers |
newAnswers required | Array of strings New answers |
object (Content) |
{- "Poll": {
- "question": "New question from API?",
- "description": "New description from API?",
- "allow_multiple": 0,
- "is_random": 1,
- "anonymous": 0,
- "show_result_after_close": 0
}, - "answers": [
- {
- "1": "Updated first answer"
}, - {
- "2": "Updated second answer"
}, - {
- "3": "Updated third answer"
}
], - "newAnswers": [
- "Fourth answer",
- "Fifth answer"
], - "content": {
- "metadata": {
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false
}, - "topics": [
- {
- "name": "News"
}
]
}
}
{- "id": 4,
- "contentcontainer_id": 2,
- "question": "Poll question from API?",
- "description": "Poll description from API",
- "allow_multiple": 1,
- "created_at": "2021-07-20 09:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 09:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "is_random": 1,
- "closed": 1,
- "anonymous": 0,
- "show_result_after_close": 0,
- "answers": [
- {
- "id": 1,
- "poll_id": 4,
- "answer": "First answer text",
- "created_at": "2021-07-20 10:43:12",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2021-07-20 10:43:12",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}
}
], - "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
id required | integer The id of the poll |
answers | Array of integers[ items ] Selected answers |
{- "answers": [
- 1,
- 4
]
}
{- "code": 200,
- "message": "You have voted."
}