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

Method Endpoint Description
GET /surveys/ Load survey questions
POST /surveys/ Submit votes/survey responses
POST /surveys/dismiss/ Record 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/surveys/', {
  headers: { 'Authorization': publicKey }
}).then(r => r.json());

3. Submit Response

Submit the panelist’s votes:

const result = await fetch('https://api.votito.com/public/surveys/', {
  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

Status Error Description
401 Unauthorized Missing or invalid token
403 Forbidden Token expired or survey closed
400 invalid_response Response data is invalid