Skip to main content

API Specifications

Welcome to the API Specifications section. This area provides comprehensive, auto-generated documentation for all Prisjakt APIs, including detailed endpoint specifications, request/response schemas, and interactive testing capabilities. If you haven´t already, please follow the Getting Started guide first to make sure you have credentials ready.

Interactive API Testing

The specification pages include an interactive UI that enables you to test API endpoints directly in your browser without writing code.

Obtaining an Access Token

  1. Navigate to the token endpoint
  2. Enter your client_id (provided during onboarding)
  3. Enter your client_secret (provided during onboarding)
  4. Select grant_type = client_credentials from the dropdown
  5. Click Send api request
  6. Copy the access_token value from the response

Testing an Endpoint

  1. Select your desired API endpoint from the sidebar
  2. Locate the Security section on the endpoint page
  3. Select Security Scheme = OAuth2Client Credentials (if required by the endpoint)
  4. Paste your access token into the Bearer token field
  5. Configure any required parameters or request body
  6. Click Send api request to execute the call

The response will be displayed directly in the browser, including status codes, headers, and body content.

Client Code Generation

Each API specification page includes automatic client code generation for multiple programming languages. This feature accelerates development by providing ready-to-use code snippets tailored to your specific API calls.

How to Generate Client Code

  1. Follow the interactive testing steps above to configure an endpoint with your credentials and parameters
  2. After configuring the request, locate the Code Generation section to the top right of each endpoint page
  3. Select your preferred programming language from the available options
  4. Copy the generated code, which includes:
    • Your authentication token
    • Configured endpoint URLs
    • Request parameters and headers
    • Language-specific best practices

Best Practices

  • Review generated code before production use
  • Replace hardcoded credentials with environment variables or secure configuration management
  • Add appropriate error handling for your application context
  • Implement token caching and refresh logic as outlined in the Calling an API guide