Introduction to Authentication

Making a request to Skylark

Skylark's API uses GraphQL, and as such all requests are made via POST requests.

It currently requires an API key to be supplied in the header Authorization.

When you create a Skylark account you will be issued with 4 API keys for different roles, each with a different set of permissions.

Account Permissions

Different levels of permission are required to access certain queries, mutations and features in the Skylark API.

The permissions in Skylark are:

PermissionExplainer
READThis permission gives access to the Query type except any query that relate to self configuration, such as getObjectConfiguration.
WRITEThis permission gives access to the Mutation type except any mutation that related to self configuration, such as createObjectConfiguration.
SELF_CONFIGThis permission gives access to all queries and mutations that relate to data model self configuration.
IGNORE_AVAILABILITYThis permission, in connection with the READ permission, allows use of the ignore_availability argument when querying.
TIME_TRAVELThis permission, in connection with the READ permission, allows use of the x-time-travel header when querying.
ACCOUNT_SETUPThis permisison is used for reading and writing certain objects that relate to account configuration. This includes setting up playback/DRM providers, playback URL templates, and playback details.

Roles

The roles that are provided each contain a set of different permissions.

RolePermissionsExample Token
READ_ONLYREADskylark-read-only-KujUUrSQZU-PVHIPmLJUX8mtZeDR5t-OF7TuwiEnrQM
READ_WRITEREAD, WRITEskylark-read-write-dU09OM6uRIzGlN-y4Zym1majgnzss26dOJFWKzyT6FI
EDITORREAD, WRITE, IGNORE_AVAILABILITY, TIME_TRAVELskylark-editor-2MiHfUIOjXU3bq3KmwlEGmnso9XXQodioE2tqfsrpWA
ADMINREAD, WRITE, IGNORE_AVAILABILITY, TIME_TRAVEL, SELF_CONFIG, ACCOUNT_SETUPskylark-admin-vwvmMNJBClMLMHCKYF9EhPXPU8sJac9d9dMiOh1f3DI

Example

In this example we're performing an authenticated listEpisode request:

curl --location --request POST '<GraphQL URL>' \
--header 'Authorization: <API KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"{listEpisode {objects {title}}}","variables":{}}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "<API KEY>");
myHeaders.append("Content-Type", "application/json");

var graphql = JSON.stringify({
  query: '{"query":"{listEpisode {objects {title}}}","variables":{}',
  variables: {}
})
var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: graphql,
  redirect: 'follow'
};

fetch("<GraphQL URL>", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
import requests
import json

url = '<GraphQL URL>'

payload={'query': '{listEpisode {objects {title}}}'}
headers = {
  'Authorization': '<API KEY>',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, data=json.dumps(payload))

print(response.text)