Update one of a worker's driving licences
const url = 'https://api2.recruso.co.uk/v1/workers/1/licences/1';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"workerId":4821,"id":5120,"licenceNumber":"BAKER905124A99AB","issueDate":"2019-06-03","expiryDate":"2029-06-02","issueNumberChecked":true}'};
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/licences/1 \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "workerId": 4821, "id": 5120, "licenceNumber": "BAKER905124A99AB", "issueDate": "2019-06-03", "expiryDate": "2029-06-02", "issueNumberChecked": true }'Replaces a driving licence held by a worker in your own agency.
This is a full replacement of that one licence, not a partial merge: a field you omit is set to null. The convictions recorded against the licence are left exactly as they are.
The licence number is unique across your whole agency, so a number another licence already carries returns 400, and the reply does not say which worker holds it. ExpiryDate must not be before IssueDate.
A licence that belongs to a different worker, or to another agency, returns 404 rather than 403. modifiedBy and modifiedOn are set from your credentials and the current UK local time; they are not taken from the request.
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 id path parameter
Request Bodyrequired
Section titled “Request Bodyrequired”The replacement values for a licence already held. Every field is written from the request, so a field you omit is set to null. The convictions recorded against the licence are untouched.
object
The worker the licence belongs to. Taken from the route; a value in the request body is ignored.
Example
4821The licence to update. Taken from the route; a value in the request body is ignored.
Example
5120The licence number, up to 50 characters. Required, and unique across your whole agency — two workers cannot hold the same licence number.
Example
BAKER905124A99ABThe date the licence was issued.
Example
2019-06-03The date the licence expires. Must not be before the issue date.
Example
2029-06-02Whether the issue number has been checked against the DVLA record.
Example
trueResponses
Section titled “Responses”OK
object
The licence record’s identifier.
The licence number.
The date the licence was issued.
The date the licence expires.
Whether the issue number has been checked against the DVLA record.
How many convictions are recorded against this licence.
Example
{ "workerLicenceId": 5120, "licenceNumber": "BAKER905124A99AB", "issueDate": "2019-06-03", "expiryDate": "2029-06-02", "issueNumberChecked": true, "convictionCount": 1}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"}
