Skip to main content

Authentication

Get Access

We use Visma Connect for authentication. To get access, you need to register an application on the Visma Developer Portal by following the steps. When testing the API, please use Stage. When in production with real users, use Production.

  1. Log in to Visma Developer Portal

  2. Go to "My Applications" > "Add Application" > "Service (Machine-to-Machine)"

  3. Fill in the required details and save your application. Note down the client_id.

  4. Publish the application.

  5. Open the application and add a new integration.

  6. Select the API you want to integrate with:

    • Stage: Machine Learning Factory API Stage
    • Production: Machine Learning Factory API Prod
  7. Select the appropriate scope for your integration:

    • Stage: machine-learning-factory-api-stage:io
    • Production: machine-learning-factory-api-prod:io
  8. Wait for the integration to be accepted. Feel free to contact the Inventory Optimization team to speed up the process.

  9. Open the application, generate credentials, and securely store the client_secret.

Authenticate

To use the API you need an access token generated by Visma Connect's API. These have a lifetime of up to 60 minutes, depending on what you selected when setting up the application. To generate an access token, follow these steps:

  1. Create a POST request to the Visma Connect API:

  2. In the header of your request, specify Content-Type: application/x-www-form-urlencoded.

  3. In the request body, specify the following parameters:

    • grant_type: client_credentials
    • client_id: YOUR_CLIENT_ID_FROM_STEP_3
    • scope: YOUR_SCOPE_FROM_STEP_7
    • client_secret: YOUR_SECRET_FROM_STEP_9
  4. Send the request and retrieve the access_token from the response.

  5. Include the Authorization header with the Bearer YOUR_ACCESS_TOKEN for all your requests to the Inventory Optimization API.

  6. You are now ready to make requests to the Inventory Optimization API!

For more information about Visma Connect OAuth 2.0 Bearer Token Authentication, we refer to the Visma Connect Confluence.