EasyPlayDeveloper

Authentication

Token flow and the scope model

Token flow

Authenticate by exchanging your client credentials for a JWT:

curl -X POST https://api.easyplay.no/api_clients/token \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET"
  }'

The returned token is valid for 24 hours. Send it on every request:

Authorization: Bearer <token>

Cache the token and reuse it until it expires — don't request a new token for every API call. When it expires (or you get a 401), request a new one.

Scopes

Access is per resource instance, not per endpoint. Each API client is granted a set of scopes with this shape:

{
  "operation": "read",
  "resource": "club",
  "id": "<resource-instance-id>"
}
  • operationread or write. The external API currently exposes read endpoints, so your scopes will typically be read.
  • resource — the resource type, e.g. club.
  • id — the ID of the specific resource instance the scope applies to.

A request is allowed only if your client holds a scope matching the operation, resource type, and resource instance. Requests outside your granted scopes — including undocumented endpoints — return 403 Forbidden.

Access is granted per club

Scopes grant access to a club's resources as a whole. When your client has read access to a club, that covers everything belonging to it — the club itself, its stadiums, and the live events for the club and its stadiums. You don't need separate scopes per stadium or event: every endpoint resolves to the owning club's scope.

Errors

StatusMeaning
401 UnauthorizedMissing, malformed, or expired token. Request a new token.
403 ForbiddenValid token, but the request is outside your granted scopes (or the endpoint is not part of the external API).

On this page