Skip to main content

Polls Partner API (1.4)

Download OpenAPI specification:Download

This is the Polls Partner API. You can find out more about the Polls Platform here. This API can be used to create polls with your content.

Getting Started

In order to use this API, you will need a Partner Account. If you do not already have a partner account, reach out to us at partner@pollsplatform.com. Once your account is set up, you will receive the following:

  • API Base URL
  • API Key for QA Environemnt
  • API Key for Production Environment

API Base URL

The paths listed below are relative to the Base URL that will be provided

API Keys and Environments

The QA Environment is intended to be used during development and testing so you don't need to worry about poluting your account with test data. The environments are completely isolated from each other, so if you generate a poll in one environment you will not be able to fetch it from a different environment.

Authentication

All endpoints are authenticated using an API Key provided in the header as specified below.

ApiKeyHeader

Security Scheme Type: API Key
Header parameter name: x-api-key

Info Endpoints

The info endpoints provide metadata about the API. This is a great way to ensure you have your Base URL and API Key set properly.

Get info about the api

This endpoint is a simple GET request on /info. Below you can see the schema of the reponse, and to the right you can see an example payload.

Authorizations:
ApiKeyHeader

Responses

Response samples

Content type
application/json
{
  • "info": {
    }
}

Poll Endpoints

Polls endpoints are for creating, fetching, and updating polls

Create a new poll

This is the primary endpoint you will use. This endpoint creates a new poll. The API will echo back the poll in a similar structure with some additional details about the poll, including the Poll URL which can be opened in a new tab.

Option Types

Each option in the poll can have a different type. Different option types will have different fields, and the option type will also control the visual layout of the option in the UI. The default option type is defaultTemplate. Before you try to use an option type, please ensure that option type is enabled for your account.

Authorizations:
ApiKeyHeader
Request Body schema: application/json
required
object

Structure for Poll Model in API Requests

id
string <uuid> [ 1 .. 200 ] characters
ownerId
required
string [ 1 .. 200 ] characters
state
string
Enum: "draft" "live"
required
object
title
required
string [ 1 .. 500 ] characters
required
Array of objects
customData
object

Responses

Request samples

Content type
application/json
{
  • "poll": {
    }
}

Response samples

Content type
application/json
{
  • "poll": {
    }
}