Record a module against a Driver CPC training period
const url = 'https://api2.recruso.co.uk/v1/workers/1/cpc-training/1/modules';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"workerId":4821,"trainingId":4410,"trainingDate":"2024-02-19","trainingCentre":"Northgate Driver Training, Salford","module":"Drivers\' hours and tachograph rules","hoursCompleted":7}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api2.recruso.co.uk/v1/workers/1/cpc-training/1/modules \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "workerId": 4821, "trainingId": 4410, "trainingDate": "2024-02-19", "trainingCentre": "Northgate Driver Training, Salford", "module": "Drivers'\'' hours and tachograph rules", "hoursCompleted": 7 }'Records a module a worker in your own agency has completed within one of their Driver CPC training periods — when it was taken, where, what it covered and how many hours it counted for.
A module belongs to the period, not to the worker: it is nested under the period, and removing that period removes its modules too. The hours are summed onto the period, so they are how far through the periodic training the worker is.
TrainingDate is required. Nothing here checks the date falls inside the period, or that the hours stay under the total the training requires: both are matters of record rather than rules this API invents.
A worker or period belonging to another agency returns 404 rather than 403, so its existence is never disclosed.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The workerId path parameter
The trainingId path parameter
Request Bodyrequired
Section titled “Request Bodyrequired”A module to record against a Driver CPC training period.
object
The worker the period belongs to. Taken from the route; a value in the request body is ignored.
Example
4821The training period the module belongs to. Taken from the route; a value in the request body is ignored.
Example
4410The date the module was taken. Required — the column is NOT NULL.
Example
2024-02-19Where it was taken, up to 255 characters.
Example
Northgate Driver Training, SalfordWhat the module covered, up to 255 characters.
Example
Drivers' hours and tachograph rulesThe hours it counted for, to two decimal places.
Example
7Responses
Section titled “Responses”Created
The module as recorded.
object
The module record identifier.
The training period the module belongs to. Null only for a legacy row that was never attached to one.
The date the module was taken.
Where it was taken.
What the module covered.
The hours it counted for.
Example
{ "trainingDetailsId": 8815, "trainingId": 4410, "trainingDate": "2024-02-19", "trainingCentre": "Northgate Driver Training, Salford", "module": "Tachograph rules and driver hours", "hoursCompleted": 7}Bad Request
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
