GET /ideabank/proposals/{proposalId}/comments
List the comments on a proposal that are visible to the panelist. Requires the canComment capability, which is only granted by the community_forum access level (see Get Idea Bank). The response is paginated with an encrypted cursor.
To post a comment, use Add Comment.
Request
GET /public/ideabank/proposals/{proposalId}/comments
Path Parameters
| Parameter | Type | Description |
|---|
| proposalId | string | The proposal identifier from the proposal listing |
| Header | Required | Description |
|---|
| Authorization | Yes | Compound idea-bank token from Tenant API |
Query Parameters
| Parameter | Required | Description |
|---|
| sort | No | Sort order for comments |
| limit | No | Page size |
| cursor | No | Encrypted cursor from a previous response; omit for the first page |
Response
{
"items": [
{
"commentId": "c-abc123",
"text": "Great idea, I would use this daily.",
"authorType": "panelist",
"tsCreated": 1700000000
},
{
"commentId": "c-def456",
"text": "Thanks for the suggestion, we are reviewing it.",
"authorType": "admin",
"tsCreated": 1700001000
}
],
"cursor": "encrypted-cursor-token"
}
Response Fields
| Field | Type | Description |
|---|
| items | array | List of comment objects |
| cursor | string | (Optional) Encrypted cursor for the next page. Absent on last page. |
| Field | Type | Description |
|---|
| commentId | string | Unique comment identifier |
| text | string | The comment text (HTML stripped) |
| authorType | string | Who wrote the comment: own, panelist, or admin |
| tsCreated | integer | Unix timestamp (seconds) when the comment was posted |
The authorType field is computed relative to the requesting panelist:
| authorType | Meaning |
|---|
| own | The requesting panelist wrote this comment |
| panelist | Another panelist wrote this comment |
| admin | A researcher (idea bank owner) wrote this comment |
Comments are filtered for visibility: panelists see all comments marked visible, plus their own comments regardless of moderation status. A panelist never sees another panelist’s hidden comment.
Pages are traversed with an opaque, encrypted cursor. Because hidden comments are filtered out server-side, a page may contain fewer items than limit; keep following the cursor until the response omits it.
Examples
cURL
curl -X GET \
"https://api.votito.com/public/ideabank/proposals/p-abc123/comments" \
-H "Authorization: abc123:xyz789:ses456"
JavaScript
const listComments = async (publicKey, proposalId, { sort, limit, cursor } = {}) => {
const url = new URL(`https://api.votito.com/public/ideabank/proposals/${proposalId}/comments`);
if (sort) {
url.searchParams.set('sort', sort);
}
if (limit) {
url.searchParams.set('limit', String(limit));
}
if (cursor) {
url.searchParams.set('cursor', cursor);
}
const response = await fetch(url, {
headers: { 'Authorization': publicKey }
});
if (!response.ok) {
throw new Error(`Failed to list comments: ${response.status}`);
}
return response.json();
};
// Usage
const page = await listComments(publicKey, 'p-abc123');
page.items.forEach((c) => console.log(`[${c.authorType}] ${c.text}`));
Python
import requests
def list_comments(public_key, proposal_id, sort=None, limit=None, cursor=None):
params = {}
if sort:
params["sort"] = sort
if limit:
params["limit"] = limit
if cursor:
params["cursor"] = cursor
response = requests.get(
f"https://api.votito.com/public/ideabank/proposals/{proposal_id}/comments",
headers={"Authorization": public_key},
params=params
)
response.raise_for_status()
return response.json()
# Usage
page = list_comments(public_key, "p-abc123")
for comment in page["items"]:
print(comment["authorType"], comment["text"])
Error Handling
| Status | Error | Description |
|---|
| 401 | Unauthorized | Missing or invalid token |
| 403 | Forbidden | Token expired or malformed |
| 404 | idea-bank-not-found | Comments not enabled, proposal not open, or idea bank not accessible |
Notes
- Comments are only available when the idea bank’s access level is
community_forum (canComment is true). - The cursor is encrypted; do not parse it or construct cursors yourself.
- Comment text is returned with HTML stripped, matching what was stored at post time.