Panelist API Overview

The Panelist API enables client-side interactions for voting and survey responses. Use it to build custom voting interfaces.

Base URL

https://api.votito.com/public

Authentication

Panelist API uses compound tokens obtained from the Tenant API. Include the token in the Authorization header:

Authorization: {publicKey}

The publicKey is returned by the Tenant API’s panelist access endpoint.

Endpoints

MethodEndpointDescription
GET/surveyLoad survey questions
POST/surveySubmit votes/survey responses
POST/survey/dismissRecord survey dismissal

Workflow

1. Get Voting Token

First, your backend calls the Tenant API to get a token:

// Server-side
const { panelist } = await fetch(`https://api.votito.com/tenant/surveys/${surveyId}/panelists/${customerId}`, { headers: { 'X-API-Key': apiKey } }).then((r) =>
	r.json()
);

// Pass panelist.publicKey to your frontend

2. Load Survey

Use the token to load survey questions:

// Client-side
const survey = await fetch('https://api.votito.com/public/survey', {
	headers: { 'Authorization': publicKey }
}).then((r) => r.json());

3. Submit Response

Submit the panelist’s votes:

const result = await fetch('https://api.votito.com/public/survey', {
	method: 'POST',
	headers: {
		'Authorization': publicKey,
		'Content-Type': 'application/json'
	},
	body: JSON.stringify({
		responses: {
			'question-1': { optionId: '3' },
			'question-2': { optionId: '1' }
		},
		isFinal: true
	})
}).then((r) => r.json());

Error Handling

StatusErrorDescription
401UnauthorizedMissing or invalid token
403ForbiddenToken expired or survey closed
400invalid_responseResponse data is invalid

Reference