updateDriver
updateDriver
Overview
This method updates an existing driver.
This method requires the Drivers:Update permission to be associated with your role.
Permissions
The permission for this api is stored in [gb_api_permissions]permission as 'Drivers:Update'.
Only roles with a stored link to this permission in [gb_role_api_permissions] can run this api.
HTTP Method
Use the HTTP Method 'PUT' for consuming this web service.
URL Examples
https://api.demo.catch-e.com/fm/drivers/4321
https://api.{{environment}}.catch-e.com/fm/drivers/4321
https://api.test.catch-e.com/fm/drivers/4321 Input Fields (Header)
Path Parameters
Input Fields (JSON)
The driver record has around 160 fields. The fields you can update are the same driver fields described in getDriver and createDrivers; see those articles for the full field list.
Example
{ "mobile": "[MOBILE-E164]", "email": "[EMAIL]", "address1": "[ADDRESS-LINE-1]", "postcode": "2000" } The example is shortened. Only a selection of fields is shown.
Duplicate Driver Warnings
The API checks the client's other drivers for a duplicate name (same given name and surname) or a duplicate employee number. Matching ignores upper or lower case and leading or trailing spaces.
The check is made on the driver as it will be after the update. Any field not sent is taken from the driver's stored record, so an update that sends only a new surname is compared using the stored given name. An update that moves the driver to another client is checked against the new client.
This means any update to a driver who already shares a name or employee number with another driver at the client is refused until resent with the override, even if the update changes an unrelated field.
A duplicate returns a 422 with the warning. Where both duplicates are found, both are returned together. Resend with override_warnings_flag set to yes to save the update.
Response Details
Success
200 - OK
The driver was updated successfully. The swagger defines the response body only as a JSON object, with no fields listed.
Error Response Details
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized" } { "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden" } { "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Found", "status": 404, "detail": "Not Found" } { "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Acceptable", "status": 406, "detail": "Not Acceptable" } { "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unsupported Media Type", "status": 415, "detail": "Not Acceptable" } { "warning_messages": {}, "validation_messages": { "fieldName": { "validationExceptionCode": "A textual description of the validation exception" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } { "warning_messages": { "surname": { "duplicateDriverName": "Driver 'Alex Smith' already exists for Client 'Example Client Pty Ltd'" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } { "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" } { "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" } Was this helpful?
Still need help? Ask the team