Create a training path
This endpoint allows creating a training path in the business catalog, grouping several courses and defining the schedule of all their trainings.
POST /api/v2/businesses/{businessId}/training-paths
Below is a detailed explanation of each of the fields that can make up the request body, with some being mandatory for the request to be successful.
|
Mandatory fields are marked with an asterisk (*). |
Request body
| JSON Analysis |
|---|
Details
|
Request example
Once the analysis of the different fields has been done, an example of the request is shown:
POST /api/v2/businesses/BUSINESSID/training-paths
{
"id": "TP-RES",
"name": "Shift manager",
"abbreviation": "RES",
"color": "#C3AAFC",
"description": "Full path: store, sales, cash register and closing",
"courseIds": [
"CRS-BTI",
"CRS-VAC",
"CRS-CAJ",
"CRS-CIE"
]
}
If the request is correct, the response will be a 201 Created with the created training path.
Considerations
The trainingsOrder field defines on which day of the training path and in which order each training of its courses takes place. If provided, it must meet the following conditions:
-
It must include exactly all the trainings of all the courses of the training path, without repeating any.
-
It must respect the internal order of each course. Trainings from different courses can be interleaved.
If trainingsOrder is not provided, Orquest calculates the schedule automatically: courses are chained in the order of courseIds given in the request body and each one starts the day after the previous course.
All the identifiers in the request (courses and trainings) are external identifiers and must exist in the business.
If the id of the training path is not provided, Orquest generates an identifier automatically and returns it in the response.
|
The request is not idempotent: if it is repeated with the same |
Error codes
In addition to the common errors, this endpoint can return the following codes:
| Code | Message | Description |
|---|---|---|
|
Course not found: <courseId> |
One of the courses in |
Training not found in the training path courses: <training> |
One of the trainings in |
|
|
At least one course is required |
The |
One or more courses not found |
The |
|
Name cannot be longer than 50 characters |
The |
|
Description cannot be longer than 500 characters |
The |
|
Abbreviation cannot be longer than 5 characters |
The |
|
- |
The |
|
Training path order contains duplicate training ids |
The |
|
Training path order must contain exactly all trainings from all courses, no more and no less |
The |
|
Training path order does not respect the internal order of course |
The schedule in |
|
|
The request conflicts with data already stored |
A training path with the given |
Useful links
What is a training path?
What is a course?