Skip to main content

Persisted Operations

Persisted Operations (POPs) are pre-defined GQL queries that should be used in favor of direct GraphQL queries whenever possible. POPs endpoint responses are globally cacheable and deliverable from the edge for much faster response times than custom direct queries.

Authentication

API user authentication

API users are assigned and associated with exactly one station. See HTTP API - API Auth for information about how to obtain a token.

Making a request

A POPs request is comprised of:

  1. the base URL,
  2. a version identifier,
  3. the POP name, and
  4. any query parameters (arguments).

The complete format is: {basUrl}/{versionIdentifier}/{popName}?{queryParameters}

Example: https://dev.api.localstreaming.org/pops/v1/getMovies?country=US&genreVibes=food&genreVibes=drama&sortByField=createdAt&sortByOrder=desc&stationId=93c39d90-e15f-4cf3-b719-f22296eb853a

Base URL

Development

https://dev.api.localstreaming.org/pops

Production

https://api.localstreaming.org/pops

Version identifier

The initial version identifier is v1.

Any breaking changes made to POPs queries in the future will require a new version identifier.

POP name

Determines which query will be run. E.g., getStation, getShow, getLikes, etc.

Query parameters

The GraphQL query arguments are set via HTTP query parameters.

E.g., to set the stationId for a POP request, add ?stationId={stationId} as a query parameter.

Query parameters can be set multiple times to create an array: ?genreVibes=food&genreVibes=drama.