DJUST Authentication API (automated)

DJUST APIs rely on authentication to make requests. To use DJUST APIs, you need to include an authentication token in the request headers.

Requirements

  • Your API key (dj-api-key) provided by DJUST.
  • At least one customer user has been created in your back-office.

Endpoints

Request Access Token

Endpoint

  • URL: POST /auth/token
  • Operation ID: AUTH-101
  • Summary: Ask for an access token.

Request

Headers
Header Type Required Description
dj-client string required The type of client, must be one of "OPERATOR," "ACCOUNT," or "SUPPLIER."
dj-api-key string required Your API key for authentication.
dj-store string optional The store identifier, if applicable.
dj-store-view string optional The store view identifier, if applicable.

Request Body

  • Content Type: application/json
  • Schema: TokenRequest
  • Required: true

Example Request

POST /auth/token
dj-client: OPERATOR
dj-api-key

: your-api-key
dj-store: store-123
dj-store-view: view-456

{
    "username": "your-username",
    "password": "your-password"
}

Response

Copy the access token and save it, as you will need it to authenticate for future requests.

Check if Token is Valid

Endpoint

  • URL: GET /auth/is-token-valid
  • Operation ID: TOK-200
  • Summary: Return true if the token exists and is not expired.

Request

Headers
Header Type Required Description
dj-client string required The type of client, must be one of "OPERATOR," "ACCOUNT," or "SUPPLIER."
dj-api-key string required Your API key for authentication.
dj-store string optional The store identifier, if applicable.
dj-store-view string optional The store view identifier, if applicable.
Query Parameters
  • token (string, required): The authentication token to check.

Example Request

GET /auth/is-token-valid?token=your-auth-token
dj-client: OPERATOR
dj-api-key: your-api-key
dj-store: store-123
dj-store-view: view-456

Response

  • Status Code: 200
  • Content Type: */*
  • Response Type: boolean
  • Description: OK

Refresh Token

Endpoint

  • URL: POST /auth/refresh-token
  • Operation ID: AUTH-102
  • Summary: Ask for an access token from a refresh token.

Request

Headers
Header Type Required Description
dj-client string required The type of client, must be one of "OPERATOR," "ACCOUNT," or "SUPPLIER."
dj-api-key string required Your API key for authentication.
dj-store string optional The store identifier, if applicable.
dj-store-view string optional The store view identifier, if applicable.

Request Body

Example Request

POST /auth/refresh-token
dj-client: OPERATOR
dj-api-key: your-api-key
dj-store: store-123
dj-store-view: view-456

{
    "refreshToken": "your-refresh-token"
}

Response

Reset Password

Endpoint

  • URL: POST /auth/reset-password
  • Operation ID: PWD-102
  • Summary: Reset password.

Request

Headers
Header Type Required Description
dj-client string required The type of client, must be one of "OPERATOR," "ACCOUNT," or "SUPPLIER."
dj-api-key string required Your API key for authentication.
dj-store string optional The store identifier, if applicable.
dj-store-view string optional The store view identifier, if applicable.

Request Body

Example Request

POST /auth/reset-password
dj-client: OPERATOR
dj-api-key: your-api-key
dj-store: store-123
dj-store-view: view-456

{
    "newPassword": "new-password",
    "resetPasswordToken": "your-reset-password-token"
}

Response

  • Status Code: 200
  • Description: OK

Revoke Token

Endpoint

  • URL: POST /auth/revoke-token
  • Operation ID: AUTH-103
  • Summary: Delete the current token session.

Request

Headers
Header Type Required Description
dj-client string required The type of client, must be one of "OPERATOR," "ACCOUNT," or "SUPPLIER."
dj-api-key string required Your API key for authentication.
dj-store string optional The store identifier, if applicable.
dj-store-view string optional The store view identifier, if applicable.

Example Request

POST /auth/revoke-token
dj-client: OPERATOR
dj-api-key: your-api-key
dj-store: store-123
dj-store-view: view-456

Response

  • Status Code: 200
  • Description: OK

Send Reset Password Email

Endpoint

  • URL: POST /auth/send-reset-password-email
  • Operation ID: PWD-101
  • Summary: Send an email for password reset.

Request

Headers
Header Type Required Description
dj-client string required The type of client, must be one of "OPERATOR," "ACCOUNT," or "SUPPLIER."
dj-api-key string required Your API key for authentication.
dj-store string optional The store identifier, if applicable.
dj-store-view string optional The store view identifier, if applicable.

Request Body

Example Request

POST /auth/send-reset-password-email
dj-client: OPERATOR
dj-api-key: your-api-key
dj-store: store-123
dj-store-view: view-456

{
    "email": "user@example.com",
    "redirectUrl": "https://example.com/reset-password"
}

Response

  • Status Code: 200
  • Description: OK

Data Models

AuthenticatedUserDto

  • Type: object
  • Properties:
    • id (string, required)

AuthenticationResponseDto

  • Type: object
  • Properties:
    • token (TokenResponse)
    • user (AuthenticatedUserDto)

RefreshTokenRequest

  • Type: object
  • Properties:
    • refreshToken (string)

ResetPasswordRequest

  • Type: object
  • Properties:
    • newPassword (string)
    • resetPasswordToken (string, format: uuid)

SendResetPasswordEmailRequest

  • Type: object
  • Properties:
    • email (string)
    • redirectUrl (string)

TokenRequest

  • Type: object
  • Properties:
    • password (string)
    • username (string)

TokenResponse

  • Type: object
  • Properties:
    • accessToken (string)
    • expireAt (integer, format: int64)
    • refreshToken (string)