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 identifiers

v1

The initial version identifier for production-ready POPs.

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

experimental

In progress or incomplete POPs that may change dramatically before being added to a production-ready version identifier.

DO NOT USE these queries for any production applications.

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.