Skip to main content

API Reference

Automatic Rostering (json_alpha)

Download OpenAPI specification:Download

Visma Connect Token Retrieval

  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_ID_FROM_STEP_1.3
    • client_secret: YOUR_SECRET_FROM_STEP_1.9
    • scope: SCOPE_FROM_STEP_1.7
  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 Automatic Rostering API.

  6. You are now ready to make requests to the Automatic Rostering API.

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

Create roster

Endpoints for starting, stopping, and retrieving scheduling jobs

Start job

Creates and immediately starts a new job for the solver.

Authorizations:
vismaConnectBearer
header Parameters
CUSTOMER_ID
required
string
Example: resolve
USER_ID
required
string
Example: dev_team
Request Body schema: application/json
required
required
object (jobInfo)

Details about the job that the solver will solve.

Array of objects (shift)

List of shifts that employees can be assigned to.

Array of objects (shiftTemplate)

List of shift templates that the solver can use to generate shifts.

required
Array of objects (employee) non-empty

List of employees to be used in this roster.

Array of objects (taskGroup)

List of task groups used in this roster.

Array of objects (task)

List of tasks used in this roster.

Array of objects (timeSlot)

List of time slots for which demand can be specified (only if using TIME_DEMAND)

required
Array of objects (demand)

List of demands used in this roster.

object

Constraints that should be active for this solver run. Used to specify all sorts of preferences, rules and restrictions.

required
object (configuration)

Configurations for this solver run.

Responses

Request samples

Content type
application/json
{
  • "jobInfo": {
    },
  • "shifts": [
    ],
  • "employees": [
    ],
  • "timeSlots": [
    ],
  • "demands": [
    ],
  • "constraints": { },
  • "configuration": {
    }
}

Response samples

Content type
application/json
{
  • "jobId": "78f0aawf13a0436f916cd6gf468afc61",
  • "statusCode": "starting",
  • "link": {
    }
}

Get job status

Returns the current state of the specified solver job, including whether it is still running or has stopped.

Authorizations:
vismaConnectBearer
path Parameters
id
required
string

Job ID

Responses

Response samples

Content type
application/json
{
  • "jobId": "78f0bb4312a04d6f906bd6afe68afa61",
  • "statusCode": "stopped",
  • "duration": 7274,
  • "links": [
    ]
}

Stop job

Stops a running solver job.

Authorizations:
vismaConnectBearer
path Parameters
id
required
string

Job ID

Responses

Get result

Returns the current best solution produced by the solver for the specified job.

Authorizations:
vismaConnectBearer
path Parameters
id
required
string

Job ID

Responses

Response samples

Content type
application/json
{
  • "jobInfo": {
    },
  • "solution": {
    },
  • "infeasibleConstraints": [
    ],
  • "id": "string",
  • "organisationId": "string",
  • "scheduleType": {
    }
}

Get request

Returns the payload that was sent to the API when starting the job.

Authorizations:
vismaConnectBearer
path Parameters
id
required
string

Job ID

Responses

Response samples

Content type
application/json
{
  • "jobInfo": {
    },
  • "shifts": [
    ],
  • "employees": [
    ],
  • "timeSlots": [
    ],
  • "demands": [
    ],
  • "constraints": { },
  • "configuration": {
    }
}

Analyze (WIP)

Endpoint for analyzing job requests

Analyze

WIP - Analyze a job request. Currently returns a dummy response.

Authorizations:
vismaConnectBearer
header Parameters
CUSTOMER_ID
required
string
Example: resolve
USER_ID
required
string
Example: dev_team
ACCEPT_LANGUAGE
string
Default: en-US
Example: no-NO

Language code for localizing warning messages

Request Body schema: application/json
required
required
object (jobInfo)

Details about the job that the solver will solve.

Array of objects (shift)

List of shifts that employees can be assigned to.

Array of objects (shiftTemplate)

List of shift templates that the solver can use to generate shifts.

required
Array of objects (employee) non-empty

List of employees to be used in this roster.

Array of objects (taskGroup)

List of task groups used in this roster.

Array of objects (task)

List of tasks used in this roster.

Array of objects (timeSlot)

List of time slots for which demand can be specified (only if using TIME_DEMAND)

required
Array of objects (demand)

List of demands used in this roster.

object

Constraints that should be active for this solver run. Used to specify all sorts of preferences, rules and restrictions.

required
object (configuration)

Configurations for this solver run.

Responses

Request samples

Content type
application/json
{
  • "jobInfo": {
    },
  • "shifts": [
    ],
  • "employees": [
    ],
  • "timeSlots": [
    ],
  • "demands": [
    ],
  • "constraints": { },
  • "configuration": {
    }
}

Response samples

Content type
application/json
{
  • "jobId": "2b74",
  • "warnings": [
    ]
}

Feasibility

Endpoints for checking feasibility of jobs

Feasibility Check

Check jobs feasibility.

Authorizations:
vismaConnectBearer
header Parameters
CUSTOMER_ID
required
string
Example: resolve
USER_ID
required
string
Example: dev_team
Request Body schema: application/json
required
required
object (jobInfo)

Details about the job that the solver will solve.

Array of objects (shift)

List of shifts that employees can be assigned to.

Array of objects (shiftTemplate)

List of shift templates that the solver can use to generate shifts.

required
Array of objects (employee) non-empty

List of employees to be used in this roster.

Array of objects (taskGroup)

List of task groups used in this roster.

Array of objects (task)

List of tasks used in this roster.

Array of objects (timeSlot)

List of time slots for which demand can be specified (only if using TIME_DEMAND)

required
Array of objects (demand)

List of demands used in this roster.

object

Constraints that should be active for this solver run. Used to specify all sorts of preferences, rules and restrictions.

required
object (configuration)

Configurations for this solver run.

Responses

Request samples

Content type
application/json
{
  • "jobInfo": {
    },
  • "shifts": [
    ],
  • "employees": [
    ],
  • "timeSlots": [
    ],
  • "demands": [
    ],
  • "constraints": { },
  • "configuration": {
    }
}

Response samples

Content type
application/json
{
  • "version": "string",
  • "status": [
    ],
  • "warnings": [
    ],
  • "infeasibilities": [
    ],
  • "errors": [
    ],
  • "timeouts": [
    ]
}

Roster request

required
object (jobInfo)

Details about the job that the solver will solve.

Array of objects (shift)

List of shifts that employees can be assigned to.

Array of objects (shiftTemplate)

List of shift templates that the solver can use to generate shifts.

required
Array of objects (employee) non-empty

List of employees to be used in this roster.

Array of objects (taskGroup)

List of task groups used in this roster.

Array of objects (task)

List of tasks used in this roster.

Array of objects (timeSlot)

List of time slots for which demand can be specified (only if using TIME_DEMAND)

required
Array of objects (demand)

List of demands used in this roster.

object

Constraints that should be active for this solver run. Used to specify all sorts of preferences, rules and restrictions.

required
object (configuration)

Configurations for this solver run.

{
  • "jobInfo": {
    },
  • "shifts": [
    ],
  • "employees": [
    ],
  • "timeSlots": [
    ],
  • "demands": [
    ],
  • "constraints": { },
  • "configuration": {
    }
}