API Documentation

Authorization Overview

SpectR API uses a two-step authentication process:

  1. Authenticate with API key and tenant ID to receive a JWT token.
  2. Use the JWT token in the Authorization header for all subsequent requests.

Tokens expire after a configured period. Check the expiresAt field in the response and refresh the token before it expires.

Authorization Endpoint

POST https://spectr.sdsoft.cz/auth/v1/api-key/token

Headers

Example Request

POST https://spectr.sdsoft.cz/auth/v1/api-key/token
X-Api-Key: your-api-key-here
X-Tenant-Id: your-tenant-id-here
            

Request Body

None

Response

Success (200 OK):

{
  "apiKeyIdentityId": "string",
  "token": "string",
  "expiresAt": "2023-12-31T23:59:59Z"
}
            

Error (400 Bad Request): If headers are missing.

Error (401 Unauthorized): If authentication fails.

Token Expiration

The returned token has an expiration time specified in the expiresAt field. You must refresh the token before it expires by calling this endpoint again. Store the expiresAt value and refresh proactively to avoid authentication failures.

Inspection Endpoint

POST https://spectr.sdsoft.cz/station/v1/inspections/single-sku

Headers

Example Request

POST https://spectr.sdsoft.cz/station/v1/inspections/single-sku
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json
            

Request Body

{
  "stationId": "uuid",
  "timeStamp": "2023-12-31T23:59:59Z",
  "slotsCount": 1,
  "slots": [
    {
      "x_axis": 1,
      "y_axis": 1,
      "productId": 123,
      "sku": "SKU123",
      "quantity": 1
    }
  ]
}
            

Response

Success (202 Accepted): Inspection accepted.

Error: Various error responses based on validation.