API Reference
Automatic Rostering (json_alpha)
Download OpenAPI specification:Download
Create a POST request to the Visma Connect API:
- For the stage environment, use: https://connect.identity.stagaws.visma.com/connect/token
- For the production environment, use: https://connect.visma.com/connect/token
In the header of your request, specify
Content-Type: application/x-www-form-urlencoded
.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
Send the request and retrieve the
access_token
from the response.Include the
Authorization
header with theBearer YOUR_ACCESS_TOKEN
for all your requests to the Automatic Rostering API.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.
Feasibility Check
Check jobs feasibility.
Authorizations:
header Parameters
CUSTOMER_ID required | string Example: resolve |
USER_ID required | string Example: dev_team |
Request Body schema: application/jsonrequired
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
- Payload
{- "jobInfo": {
- "id": "123",
- "organisationId": "456",
- "scheduleType": "CALENDAR",
- "demandType": "TIME_DEMAND",
- "planningHorizon": {
- "startDate": "2023-02-27",
- "endDate": "2023-04-02",
- "fteStartDay": {
- "date": "2023-03-01"
}, - "fteEndDay": {
- "date": "2023-03-31"
}
}
}, - "shifts": [
- {
- "id": "shift1",
- "intervals": [
- {
- "startTime": "08:00",
- "endTime": "16:00",
- "dayIndicator": 1,
- "workTypeId": "1"
}
]
}
], - "employees": [
- {
- "id": "1"
}
], - "timeSlots": [
- {
- "id": "timeSlot1"
}, - {
- "startTime": "00:00"
}, - {
- "endTime": "00:00"
}, - {
- "workTypeId": "1"
}
], - "demands": [
- {
- "days": null,
- "dates": [
- "2023-03-01",
- "2023-03-02",
- "2023-03-03",
- "2023-03-04",
- "2023-03-05",
- "2023-03-06",
- "2023-03-07"
], - "timeDemands": [
- {
- "timeSlotId": "timeSlot1",
- "min": 1,
- "ideal": 2,
- "max": 3
}
]
}
], - "constraints": { },
- "configuration": {
- "workTypes": [
- {
- "id": "1",
- "name": "WORK",
- "factor": 1
}
], - "weekend": {
- "startWeekDay": 5,
- "startTime": "00:00",
- "endWeekDay": 1,
- "endTime": "00:00"
}
}
}
Response samples
- 200
- 400
- 406
- 415
{- "version": "string",
- "status": [
- "string"
], - "warnings": [
- {
- "title": "Employee-availability-check",
- "category": "string",
- "description": "string",
- "violations": [
- {
- "day": 0,
- "date": "2019-08-24",
- "demandSegment": {
- "startTime": 0,
- "endTime": 0,
- "minDemand": 0,
- "timestamp": "string"
}, - "shift": {
- "name": "string"
}, - "weekendNumber": 0,
- "requiredEmployees": 0,
- "missingEmployees": 0,
- "missingEmployeesDueToWeekendDistribution": 0,
- "employeeNumber": "string",
- "requiredMinutes": 0,
- "achievableMinutes": 0,
- "startTime": "string",
- "endTime": "string",
- "personnelGroup": "string",
- "assignment": "string",
- "taskId": "string",
- "competencies": [
- "string"
], - "workType": "string",
- "numberOfEmployees": 0,
- "missingMinutes": 0,
- "totalMinutes": 0,
- "constraintId": "string",
- "lockedShiftName": "string",
- "employeeId": "string",
- "violatedProperties": [
- "MIN"
]
}
]
}
], - "infeasibilities": [
- {
- "title": "Cyclic-connected-shifts-Check",
- "category": "string",
- "description": "string",
- "violations": [
- {
- "day": 0,
- "date": "2019-08-24",
- "demandSegment": {
- "startTime": 0,
- "endTime": 0,
- "minDemand": 0,
- "timestamp": "string"
}, - "shift": {
- "name": "string"
}, - "weekendNumber": 0,
- "requiredEmployees": 0,
- "missingEmployees": 0,
- "missingEmployeesDueToWeekendDistribution": 0,
- "employeeNumber": "string",
- "requiredMinutes": 0,
- "achievableMinutes": 0,
- "startTime": "string",
- "endTime": "string",
- "personnelGroup": "string",
- "assignment": "string",
- "taskId": "string",
- "competencies": [
- "string"
], - "workType": "string",
- "numberOfEmployees": 0,
- "missingMinutes": 0,
- "totalMinutes": 0,
- "constraintId": "string",
- "lockedShiftName": "string",
- "employeeId": "string",
- "violatedProperties": [
- "MIN"
]
}
]
}
], - "errors": [
- "string"
], - "timeouts": [
- "string"
]
}
Feasibility Check V2 Deprecated
[WILL BE REMOVED]. Use /feasibility instead. Both feasibility endpoints have the same functionality and schema.
Authorizations:
header Parameters
CUSTOMER_ID required | string Example: resolve |
USER_ID required | string Example: dev_team |
Request Body schema: application/jsonrequired
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
- Payload
{- "jobInfo": {
- "id": "123",
- "organisationId": "456",
- "scheduleType": "CALENDAR",
- "demandType": "TIME_DEMAND",
- "planningHorizon": {
- "startDate": "2023-02-27",
- "endDate": "2023-04-02",
- "fteStartDay": {
- "date": "2023-03-01"
}, - "fteEndDay": {
- "date": "2023-03-31"
}
}
}, - "shifts": [
- {
- "id": "shift1",
- "intervals": [
- {
- "startTime": "08:00",
- "endTime": "16:00",
- "dayIndicator": 1,
- "workTypeId": "1"
}
]
}
], - "employees": [
- {
- "id": "1"
}
], - "timeSlots": [
- {
- "id": "timeSlot1"
}, - {
- "startTime": "00:00"
}, - {
- "endTime": "00:00"
}, - {
- "workTypeId": "1"
}
], - "demands": [
- {
- "days": null,
- "dates": [
- "2023-03-01",
- "2023-03-02",
- "2023-03-03",
- "2023-03-04",
- "2023-03-05",
- "2023-03-06",
- "2023-03-07"
], - "timeDemands": [
- {
- "timeSlotId": "timeSlot1",
- "min": 1,
- "ideal": 2,
- "max": 3
}
]
}
], - "constraints": { },
- "configuration": {
- "workTypes": [
- {
- "id": "1",
- "name": "WORK",
- "factor": 1
}
], - "weekend": {
- "startWeekDay": 5,
- "startTime": "00:00",
- "endWeekDay": 1,
- "endTime": "00:00"
}
}
}
Response samples
- 200
- 400
- 406
- 415
{- "version": "string",
- "status": [
- "string"
], - "warnings": [
- {
- "title": "Employee-availability-check",
- "category": "string",
- "description": "string",
- "violations": [
- {
- "day": 0,
- "date": "2019-08-24",
- "demandSegment": {
- "startTime": 0,
- "endTime": 0,
- "minDemand": 0,
- "timestamp": "string"
}, - "shift": {
- "name": "string"
}, - "weekendNumber": 0,
- "requiredEmployees": 0,
- "missingEmployees": 0,
- "missingEmployeesDueToWeekendDistribution": 0,
- "employeeNumber": "string",
- "requiredMinutes": 0,
- "achievableMinutes": 0,
- "startTime": "string",
- "endTime": "string",
- "personnelGroup": "string",
- "assignment": "string",
- "taskId": "string",
- "competencies": [
- "string"
], - "workType": "string",
- "numberOfEmployees": 0,
- "missingMinutes": 0,
- "totalMinutes": 0,
- "constraintId": "string",
- "lockedShiftName": "string",
- "employeeId": "string",
- "violatedProperties": [
- "MIN"
]
}
]
}
], - "infeasibilities": [
- {
- "title": "Cyclic-connected-shifts-Check",
- "category": "string",
- "description": "string",
- "violations": [
- {
- "day": 0,
- "date": "2019-08-24",
- "demandSegment": {
- "startTime": 0,
- "endTime": 0,
- "minDemand": 0,
- "timestamp": "string"
}, - "shift": {
- "name": "string"
}, - "weekendNumber": 0,
- "requiredEmployees": 0,
- "missingEmployees": 0,
- "missingEmployeesDueToWeekendDistribution": 0,
- "employeeNumber": "string",
- "requiredMinutes": 0,
- "achievableMinutes": 0,
- "startTime": "string",
- "endTime": "string",
- "personnelGroup": "string",
- "assignment": "string",
- "taskId": "string",
- "competencies": [
- "string"
], - "workType": "string",
- "numberOfEmployees": 0,
- "missingMinutes": 0,
- "totalMinutes": 0,
- "constraintId": "string",
- "lockedShiftName": "string",
- "employeeId": "string",
- "violatedProperties": [
- "MIN"
]
}
]
}
], - "errors": [
- "string"
], - "timeouts": [
- "string"
]
}
Start Job
Start a new solver job.
Authorizations:
header Parameters
CUSTOMER_ID required | string Example: resolve |
USER_ID required | string Example: dev_team |
Request Body schema: application/jsonrequired
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
- Payload
{- "jobInfo": {
- "id": "123",
- "organisationId": "456",
- "scheduleType": "CALENDAR",
- "demandType": "TIME_DEMAND",
- "planningHorizon": {
- "startDate": "2023-02-27",
- "endDate": "2023-04-02",
- "fteStartDay": {
- "date": "2023-03-01"
}, - "fteEndDay": {
- "date": "2023-03-31"
}
}
}, - "shifts": [
- {
- "id": "shift1",
- "intervals": [
- {
- "startTime": "08:00",
- "endTime": "16:00",
- "dayIndicator": 1,
- "workTypeId": "1"
}
]
}
], - "employees": [
- {
- "id": "1"
}
], - "timeSlots": [
- {
- "id": "timeSlot1"
}, - {
- "startTime": "00:00"
}, - {
- "endTime": "00:00"
}, - {
- "workTypeId": "1"
}
], - "demands": [
- {
- "days": null,
- "dates": [
- "2023-03-01",
- "2023-03-02",
- "2023-03-03",
- "2023-03-04",
- "2023-03-05",
- "2023-03-06",
- "2023-03-07"
], - "timeDemands": [
- {
- "timeSlotId": "timeSlot1",
- "min": 1,
- "ideal": 2,
- "max": 3
}
]
}
], - "constraints": { },
- "configuration": {
- "workTypes": [
- {
- "id": "1",
- "name": "WORK",
- "factor": 1
}
], - "weekend": {
- "startWeekDay": 5,
- "startTime": "00:00",
- "endWeekDay": 1,
- "endTime": "00:00"
}
}
}
Response samples
- 202
- 400
- 406
- 415
{- "jobId": "78f0aawf13a0436f916cd6gf468afc61",
- "statusCode": "starting",
- "link": {
- "rel": "request",
- "href": "/jobs/78f0aawf13a0436f916cd6gf468afc61/request"
}
}
Get Job Status
Get a job status.
Authorizations:
path Parameters
id required | string Job ID |
Responses
Response samples
- 200
- 406
{- "jobId": "78f0bb4312a04d6f906bd6afe68afa61",
- "statusCode": "stopped",
- "duration": 7274,
- "links": [
- {
- "rel": "request",
- "href": "/jobs/78f0bb4312a04d6f906bd6afe68afa61/request"
}, - {
- "rel": "full_schedule",
- "href": "/jobs/78f0bb4312a04d6f906bd6afe68afa61/result/?full_schedule=True"
}, - {
- "rel": "statistics",
- "href": "/jobs/78f0bb4312a04d6f906bd6afe68afa61/result/?full_schedule=False"
}
]
}
Get Result
Returns result for job
Authorizations:
path Parameters
id required | string Job ID |
Responses
Response samples
- 200
{- "jobInfo": {
- "id": "string",
- "organisationId": "string",
- "scheduleType": "CALENDAR",
- "demandType": "SHIFT_DEMAND",
- "planningHorizon": {
- "startDate": {
- "example_1": {
- "value": "2023-12-24",
- "summary": "The 24th of December 2023."
}
}, - "endDate": {
- "example_1": {
- "value": "2023-12-24",
- "summary": "The 24th of December 2023."
}
}, - "nrOfWeeks": 1,
- "fteStartDay": {
- "dayIndex": {
- "example_1": {
- "value": 9,
- "summary": "The 10th day of the planning horizon."
}
}
}, - "fteEndDay": {
- "dayIndex": {
- "example_1": {
- "value": 9,
- "summary": "The 10th day of the planning horizon."
}
}
}
}
}, - "infeasibleConstraints": [
- {
- "id": "string",
- "employeeIds": [
- "string"
]
}
], - "id": "string",
- "organisationId": "string",
- "scheduleType": {
- "weekRecurring": {
- "nrOfWeeks": 1,
- "fteCountStartDayIndex": 0,
- "fteCountEndDayIndex": 0,
- "fullScheduleStartDate": "2019-08-24"
}
}, - "solution": {
- "score": {
- "hard": 0,
- "soft": 0
}, - "missingDemands": [
- {
- "scheduleDay": {
- "dayIndex": {
- "example_1": {
- "value": 9,
- "summary": "The 10th day of the planning horizon."
}
}
}, - "startTime": "14:15:22Z",
- "endTime": "14:15:22Z",
- "demands": [
- {
- "nbrOfMissingEmployees": 0,
- "assignmentId": "string",
- "taskId": "string",
- "attributeRequirements": [
- {
- "example_1": {
- "value": {
- "id": "personnel_group",
- "values": [
- "personnel_group_morning",
- "personnel_group_afternoon"
], - "matchType": "ANY"
}, - "summary": "This example shows a requirement for an employee to be part of either the \"personnel_group_morning\" or \"personnel_group_afternoon\". If the employee is part of both groups, the requirement is satisfied as well. The employee is allowed to also be part of other personnel groups that are not specified in the requirement."
}
}
]
}
]
}
], - "wallDemandOutcome": {
- "lessThanMin": 0,
- "min": 0,
- "minIdeal": 0,
- "ideal": 0,
- "maxIdeal": 0,
- "max": 0
}, - "fteDemandOutcome": {
- "min": {
- "target": 0,
- "planned": 0
}, - "ideal": {
- "target": 0,
- "planned": 0
}, - "max": {
- "target": 0,
- "planned": 0
}
}, - "shiftDemandFulfillment": {
- "totalFulfillmentStatistics": {
- "requestedHours": 0,
- "requestedShiftAssignments": 0,
- "plannedHours": 0,
- "plannedShiftAssignments": 0
}
}, - "userDefinedShifts": [
- {
- "id": "string",
- "fteHours": 0,
- "shiftTypeIds": [
- "string"
]
}
], - "generatedShifts": [
- {
- "id": "string",
- "shiftTypeIds": [
- "string"
], - "shiftTemplateId": "string",
- "intervals": [
- {
- "startTime": "14:15:22Z",
- "endTime": "14:15:22Z",
- "dayIndicator": -1,
- "breakMinutes": 0,
- "workTypeId": "string",
- "assignmentId": "string",
- "taskId": "string"
}
]
}
], - "employeeOutcomes": [
- {
- "employeeId": "string",
- "maxAvailableHours": 0,
- "totalPlannedHours": 0,
- "plannedDays": [
- {
- "shiftId": "string",
- "scheduleDay": {
- "dayIndex": {
- "example_1": {
- "value": 9,
- "summary": "The 10th day of the planning horizon."
}
}
}, - "roleId": "string",
- "preAssigned": true
}
], - "softConstraintViolations": [
- {
- "id": "string",
- "softPenalty": 0,
- "hardPenalty": 0
}
], - "hardConstraintViolations": [
- {
- "id": "string",
- "violation": "string"
}
]
}
]
}
}
Get Request
Returns the same payload as was sent to the API when starting job.
Authorizations:
path Parameters
id required | string Job ID |
Responses
Response samples
- 200
{- "jobInfo": {
- "id": "123",
- "organisationId": "456",
- "scheduleType": "CALENDAR",
- "demandType": "TIME_DEMAND",
- "planningHorizon": {
- "startDate": "2023-02-27",
- "endDate": "2023-04-02",
- "fteStartDay": {
- "date": "2023-03-01"
}, - "fteEndDay": {
- "date": "2023-03-31"
}
}
}, - "shifts": [
- {
- "id": "shift1",
- "intervals": [
- {
- "startTime": "08:00",
- "endTime": "16:00",
- "dayIndicator": 1,
- "workTypeId": "1"
}
]
}
], - "employees": [
- {
- "id": "1"
}
], - "timeSlots": [
- {
- "id": "timeSlot1"
}, - {
- "startTime": "00:00"
}, - {
- "endTime": "00:00"
}, - {
- "workTypeId": "1"
}
], - "demands": [
- {
- "days": null,
- "dates": [
- "2023-03-01",
- "2023-03-02",
- "2023-03-03",
- "2023-03-04",
- "2023-03-05",
- "2023-03-06",
- "2023-03-07"
], - "timeDemands": [
- {
- "timeSlotId": "timeSlot1",
- "min": 1,
- "ideal": 2,
- "max": 3
}
]
}
], - "constraints": { },
- "configuration": {
- "workTypes": [
- {
- "id": "1",
- "name": "WORK",
- "factor": 1
}
], - "weekend": {
- "startWeekDay": 5,
- "startTime": "00:00",
- "endWeekDay": 1,
- "endTime": "00:00"
}
}
}
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": {
- "id": "123",
- "organisationId": "456",
- "scheduleType": "CALENDAR",
- "demandType": "TIME_DEMAND",
- "planningHorizon": {
- "startDate": "2023-02-27",
- "endDate": "2023-04-02",
- "fteStartDay": {
- "date": "2023-03-01"
}, - "fteEndDay": {
- "date": "2023-03-31"
}
}
}, - "shifts": [
- {
- "id": "shift1",
- "intervals": [
- {
- "startTime": "08:00",
- "endTime": "16:00",
- "dayIndicator": 1,
- "workTypeId": "1"
}
]
}
], - "employees": [
- {
- "id": "1"
}
], - "timeSlots": [
- {
- "id": "timeSlot1"
}, - {
- "startTime": "00:00"
}, - {
- "endTime": "00:00"
}, - {
- "workTypeId": "1"
}
], - "demands": [
- {
- "days": null,
- "dates": [
- "2023-03-01",
- "2023-03-02",
- "2023-03-03",
- "2023-03-04",
- "2023-03-05",
- "2023-03-06",
- "2023-03-07"
], - "timeDemands": [
- {
- "timeSlotId": "timeSlot1",
- "min": 1,
- "ideal": 2,
- "max": 3
}
]
}
], - "constraints": { },
- "configuration": {
- "workTypes": [
- {
- "id": "1",
- "name": "WORK",
- "factor": 1
}
], - "weekend": {
- "startWeekDay": 5,
- "startTime": "00:00",
- "endWeekDay": 1,
- "endTime": "00:00"
}
}
}