Authentication

JWT

delika API version 1 requires JSON Web Token (JWT) to authorize your requests. You may need include the Authorization HTTP header in your requests:

Authorization: bearer <YOUR_TOKEN>

Accessing the delika API server with web browser, you will get access token and refresh token.

You must not share your tokens with others. Tokens contain your identity and do anything on behalf of you.

Token Lifetime

Your tokens will expires in:

  • Access token: 1 hour
  • Refresh token: 45 days

You can renew tokens using "POST /v1/auth/token" endpoint.

Saving Token To Local Storage

When saving your token in local storage, it is recommended that you store it in the following location and format as delika's official API clients do.

File location:

  • Windows: %APPDATA%\delika\token.json
  • Linux: $HOME/.delika/token.json

File format:

{
  "Default": {
    "TokenType": "Bearer",
    "AccessToken": "ey...",
    "AccessTokenExpiresOn": "YYYY-MM-DD HH:MM:SS",
    "RefreshToken": "ey...",
    "RefreshTokenExpiresOn": "YYYY-MM-DD HH:MM:SS"
  },
  "another_key": {
    "TokenType": "Bearer",
    "AccessToken": "ey...",
    "AccessTokenExpiresOn": "YYYY-MM-DD HH:MM:SS",
    "RefreshToken": "ey...",
    "RefreshTokenExpiresOn": "YYYY-MM-DD HH:MM:SS"
  }
}

The Default key might be used as the default key by API clients.