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

ParameterTypeDescription
proposalIdstringThe proposal identifier from the proposal listing

Headers

HeaderRequiredDescription
AuthorizationYesCompound idea-bank token from Tenant API

Query Parameters

ParameterRequiredDescription
sortNoSort order for comments
limitNoPage size
cursorNoEncrypted 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

FieldTypeDescription
itemsarrayList of comment objects
cursorstring(Optional) Encrypted cursor for the next page. Absent on last page.

Comment Object

FieldTypeDescription
commentIdstringUnique comment identifier
textstringThe comment text (HTML stripped)
authorTypestringWho wrote the comment: own, panelist, or admin
tsCreatedintegerUnix timestamp (seconds) when the comment was posted

The authorType field is computed relative to the requesting panelist:

authorTypeMeaning
ownThe requesting panelist wrote this comment
panelistAnother panelist wrote this comment
adminA 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.

Pagination

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

StatusErrorDescription
401UnauthorizedMissing or invalid token
403ForbiddenToken expired or malformed
404idea-bank-not-foundComments not enabled, proposal not open, or idea bank not accessible

Notes