Skip to content

Authentication and authorization on Check API

Jay Joshua edited this page May 23, 2024 · 15 revisions

Please note that this page is a work in progress, with some content and links missing

Before reading this, make sure you are familiar with Glossary of Check terms


Check API is the API service supporting Check and the data is available through GraphQL queries.

Authentication

You'll need a token to communicate with the Check API. If you are a Check workspace owner, navigate to the Integrations settings, enable API Access, and click the + New API Key button to generate and receive an API key token for your workspace.

The authentication token must be sent on header key X-Check-Token for all requests to the GraphQL endpoint: https://check-api.checkmedia.org/api/graphql.

After receiving your token you can validate the authentication with a simple query that should return the Bot name associated to the token:

curl -X POST \
     -H 'X-Check-Token: TOKEN' \
     -H 'Content-Type: application/json' \
     -H 'X-Check-Team: <your_team_slug>' \
     --data '{ "query": "query { me { name } }" }' \
     "https://check-api.checkmedia.org/api/graphql"

Please remember to replace TOKEN with the token you received.

Authorization

The API key token is generated having editor permissions, authorizing the requestor to manage almost everything on your workspace scope.

When authenticated, Check API will identify the token and allow the requestor to retrieve and send data to your workspace.

To confirm which workspace(s) your token has access to, you can send this query:

curl -X POST \
     -H 'X-Check-Token: TOKEN' \
     -H 'Content-Type: application/json' \
     --data '{ "query": "query { me { teams { edges { node { name } } } } }" }' \
     https://check-api.checkmedia.org/api/graphql?team=<your_team_slug>

Additional reading