Correct a module in a Driver CPC training period
const url = 'https://api2.recruso.co.uk/v1/workers/1/cpc-training/1/modules/1';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"workerId":4821,"trainingId":4410,"id":8815,"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 PUT \ --url https://api2.recruso.co.uk/v1/workers/1/cpc-training/1/modules/1 \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "workerId": 4821, "trainingId": 4410, "id": 8815, "trainingDate": "2024-02-19", "trainingCentre": "Northgate Driver Training, Salford", "module": "Drivers'\'' hours and tachograph rules", "hoursCompleted": 7 }'Corrects a module already recorded within one of a worker’s Driver CPC training periods in your own agency.
This is a full replacement of that one module, not a partial merge: a field you omit is set to null. A module cannot be moved to a different period — record it against the right one and remove the wrong one.
A module that belongs to a different period, a different worker, or another agency returns 404 rather than 403. modifiedBy and modifiedOn are set from your credentials and the current UK local time.
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
The id path parameter
Request Bodyrequired
Section titled “Request Bodyrequired”The replacement values for a module already recorded. Every field is written from the request, so a field you omit is set to null.
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 module to update. Taken from the route; a value in the request body is ignored.
Example
8815The 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”OK
The module as it now stands.
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"}
