Skip to main content

Quickstart

Let's get you started with requesting access to the API through Visma Developer Portal

Getting API Access

  1. Log in to Visma Developer Portal

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

  3. Fill in the required details and save your application. Make sure to note your client_id.

  4. Publish the application.

  5. Open the application and add a new integration.

  6. Select the API you want to integrate with:

    • For the stage environment, select automatic-rostering-stage.
    • For the production environment, select automatic-rostering-prod.
  7. Select the appropriate scope for your integration:

    • For the stage environment, select automatic-rostering-stage.
    • For the production environment, select automatic-rostering-prod.
  8. Wait for the integration to be accepted. Feel free to contact the Automatic Rostering team to expedite the process.

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

Run your first job

  1. To authenticate, create a POST request to the Visma Connect API - see API Reference for instructions.

  2. Before running your first job, you need to specify the problem to be solved. Feel free to use the example payload as a starting point and check out the API reference for configurations. Use the /feasibility endpoint to evaluate the configuration. See the Feasibility section for what is being evaluated.

  3. Now you are ready to generate your first roster! Use the /jobs endpoint to start a job. The response will contain a 'statusCode' and a 'jobId' for your job.

  4. Use the /jobs/{jobId} to get status of the job.

  5. Use the /jobs/{jobId}/result to get the current best result of the job. This will always be updated with the best result as long as the job is running.

Generate code from OpenAPI Specification

The Automatic Rostering API is built on the OpenAPI Specification. You can generate code for your preferred programming language using the OpenAPI Specification.

The easiest way to get some hands-on experience with running the API is to follow our getting-started guides, so if you haven't checked those out yet, we highly recommend starting there.

Once you have some experience with designing the payloads, we highly recommend using code-generation tools to help you get started with the API through the OpenAPI specification.

  1. The OpenAPI specification for the Automatic Rostering service can be found here.

  2. The OpenAPI Generator or Swagger Codegen can be used to generate code for your preferred programming language.

    • For example, to generate a C# client with the OpenAPI Generator, you can use the following command:

        $ npx @openapitools/openapi-generator-cli generate -i ./openapi.yml -g csharp
    • There seems to be some conflicts if attempting to use the hosted resource directly

      (i.e to call with the input: -i https://docs.optimization-rostering.prod.visma.net/openapi.yml)

      so it is recommended to download the file and use it locally.