Add a driving licence to a worker
const url = 'https://api2.recruso.co.uk/v1/workers/1/licences';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"workerId":4821,"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 POST \ --url https://api2.recruso.co.uk/v1/workers/1/licences \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "workerId": 4821, "licenceNumber": "BAKER905124A99AB", "issueDate": "2019-06-03", "expiryDate": "2029-06-02", "issueNumberChecked": true }'Records a driving licence against a worker in your own agency.
The licence number is unique across your whole agency, not just across this worker: a number already recorded returns 400, and the reply does not say which worker holds it. ExpiryDate must not be before IssueDate.
Convictions are recorded against the licence rather than against the worker, and are managed through the licence’s own convictions operations.
A worker id belonging to another agency returns 404 rather than 403, so their 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
Request Bodyrequired
Section titled “Request Bodyrequired”A driving licence to record against a worker.
object
The worker the licence belongs to. Taken from the route; a value in the request body is ignored.
Example
4821The 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”Created
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"}
