Create & Modify Driver Endpoints: UpdateDriverBankAccountsList
API endpoints for creating, updating, and deleting drivers
UpdateDriverBankAccountsList
Allows you to update Driver bank accounts.
Permissions
To run this API, the nominated 'web-services' role needs to be given permission.
If you are not actively using the API, leave the permission off for better security.
Go to Roles / Apis and check on DriverBankAccounts:Update
Note: This API is not configured for external use.
Contact your Account Manager to discuss access to this API.
HTTP Method
Use the HTTP Method 'PUT' for consuming this web service.
URL Examples
https://api.catch-e.com/bank/accountsParameters - Path
| bank_accounts | array | Json Payload:
{ "driver_bank_account_id": "string", "account_name": "string", "claims_access_flag": "yes", "claims_default_flag": "yes", "status_flag": "active" }| | yes |
Sample Response (200 - Successful)
{ "driver_bank_account_id": "string", "driver_id": "string", "supplier_id": "string", "account_name": "string", "bsb": "string", "account_number": "string", "claims_default_flag": "no", "status_flag": "active"}UpdateDriverLiabilities
Overview
Allows you to update Drivers' Liabilities.
HTTP Method
Use the HTTP Method 'PUT' for consuming this web service.
Input Fields (Header)
- Header should contain the 'Content-Type' Key with the Value = 'application/json' or 'application/hjson'.
Input Fields (Body)
Single Liability update: https://api.test.catch-e.com/fm/driver/liabilities/JSON Example
Multiple Liabilities update: https://api.test.catch-e.com/fm/driver/liabilities/[ { "driver_liability_id": 3196579721328459823, "finance_liability_type_id": "16238640163402548265", "finance_liability_financier_id": "16238640163402548279", "amount": 99999.99, "monthly_payment_amount": 1234.56, "liability_limit_amount": 200099 }, { "driver_liability_id": 3196579721328459824, "finance_liability_type_id": "16238640163402548266", "finance_liability_financier_id": "16238640163402548279", "amount": 999.99, "monthly_payment_amount": 12.99 }](Successful) Output Example (sample)
{ "driver_liability_id": 3196434310060049470, "driver_id": 101211, "finance_liability_type_id": 3196195708503852473, "finance_liability_financier_id": 3196195708503852519, "driver_asset_id": null, "amount": 1234.56, "monthly_payment_amount": 34.56, "liability_payout_flag": null, "liability_end_date": null, "liability_limit_amount": 2222.22, "finance_liability_type_name": "Credit Card Limit", "finance_liability_financier_name": "NAB", "_links": { "self": { "href": "https://api.test.catch-e.com/fm/driver/liabilities/3196434310060049470" } }}Error Codes
Example error output
{ "validation_messages": { "liability_limit_amount": { "notFloat": "The input does not appear to be a float", "notGreaterThan": "The input is not greater than '0'" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation"}UpdateDriversList
Allows you to update details for multiple drivers. Creating Audit History records is optional.
Permissions
If you want to use this API in your system, enable Drivers:Update. Audit History records can be created simultaneously and you will need permissions to Audit:UserIdOverride to enable this.
Go to System Roles and select the 'web_services' role
Navigate to the Roles / APIs tab
Find the Drivers:Update permission and check its check box
Find the Audit:UserIdOverride permission and check its check box
Authenticate to api using this method Authenticate with the API, Please refer this link for login information.
HTTP Method
Use the HTTP Method 'PUT' for consuming this web service.
Input Fields (Body)
Input Fields (JSON)
Example below of updating Addresses for two Drivers - Driver IDs 101150 & 101221
{ "driver_id": "101150", "addresses": { "home": { "home_unit_no": "", "home_street_no": "", "address_1": "465 Princess Road", "address_2": "", "area": "Southland", "state": "VIC", "postcode": "3322", "country_id": null }, "post": { "home_unit_no": "", "home_street_no": "", "address_1": "PO Box 5123A", "address_2": "", "area": "Southland", "state": "VIC", "postcode": "3322", "country_id": null } },},{ "driver_id": "101221", "addresses": { "home": { "home_unit_no": "", "home_street_no": "", "address_1": "12/56 Thornton Avenue", "address_2": "", "area": "Spudly", "state": "VIC", "postcode": "3213", "country_id": null }, "post": { "home_unit_no": "", "home_street_no": "", "address_1": "2/26 Freddy Street", "address_2": "", "area": "Anothercity", "state": "VIC", "postcode": "3988", "country_id": null } }}Successful Response Example
{ "_links": { "self": { "href": "https://api.staging.catch-e.com/fm/drivers" } }, "_embedded": { "fm_drivers": [ { ... "address_id_home": "100464", "address_id_post": "100465", "addresses": { "home": { "address_1": "465 Princess Road", "address_2": "", "area": "Southland", "state": "VIC", "postcode": "3322", "country_id": null }, "post": { "address_1": "PO Box 5123A", "address_2": "", "area": "Southland", "state": "VIC", "postcode": "3322", "country_id": null } }, ... "_links": { "self": { "href": "https://api.staging.catch-e.com/fm/drivers/101150" } } }, { ... "address_id_home": "100470", "address_id_post": "100471", "addresses": { "home": { "address_1": "12/56 Thornton Avenue", "address_2": "", "area": "Spudly", "state": "VIC", "postcode": "3213", "country_id": null }, "post": { "address_1": "2/26 Freddy Street", "address_2": "", "area": "Anothercity", "state": "VIC", "postcode": "3988", "country_id": null } }, ... "_links": { "self": { "href": "https://api.staging.catch-e.com/fm/drivers/101221" } } } ] }, "total_items": 2}Error Response Details
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Bad Request", "status": 400, "detail": "JSON decoding error: Syntax error, malformed JSON"}| The JSON payload content is not formatted correctly. |
| 401 - Unauthorized | | |
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized"}| You have not authenticated before running this API or The token_timeout of the current session has passed. You need to authenticate again. |
| 403 - Forbidden | | |
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden"}| You do not have permissions for this request. Go to System Roles and enter 'web_services' Navigate to the Roles / APIs tab to make sure the permission you need to run this API is checked. |
| 422 - Failed Validation | | |
{ "validation_messages": [ { "validation_messages": [ { "driver_id": { "isEmpty": "Value is required and can't be empty" } } ], "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation"}| Driver ID must be included in the JSON payload | |
{ "warning_messages": { "employee_no": { "duplicateEmployeeNo": "Employee No 'NotBlank1' already exists for Client 'client_code'" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation"}| Duplicate Employee Numbers cannot be validated. | |
"pay_cycle_id": { "payCycleNotActive": "The selected pay cycle is not active at client level."}| You have passed a Pay Cycle where Clients / Quote Defaults "Payroll Date" is blank. Populate the Payroll Date. |
API - deidentifyDriverData
Allows you to remove personal details from Driver records where they are no longer active or linked to active Quotes, Contracts and/or Items.
Permissions
Warning: This API is restricted to Catch-e internal 'super' users.
Once the data has been de-identified, it is no longer recoverable. For this reason, access to the API is restricted and is only accessible via a Scheduler job.
HTTP Method
Use the HTTP Method 'POST' for consuming this web service.
Input Fields (Body)
Successful Response Example
Driver deidentification job was run and has completed successfully.| Driver Data has been deidentified and a DEIDENTIFY driver event event has been created against the driver record. |
Error Response Details
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized"}| You have not authenticated before running this API or The token_timeout of the current session has passed. You need to authenticate again. |
| 403 - Forbidden | | |
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden"}| You do not have permissions for this request. This is a Restricted Access API. PLease contact Catch-e staff for more information and assistance. |
| 422 - Failed Validation | | |
{ "validation_messages": { "driver_classification_query_id": { "noRecordFound": "No record matching the input was found" }| The entered driverclassificationquery_id is not recognised and/or invalid. |
Deidentify Driver Data Query
Query
A query has been written for use in a scheduler deidentify job and is available in the table.
Name: Driver deidentification query
Description: Query to identify drivers that qualify for deidentification
Logic
The logic of the deidentify query is detailed below.
It is based on the driver having been inactive for two years. This time frame can easily be updated to suit your needs.
- Drivers are excluded if
- They have any contracts where the "Suspend Date" is blank OR
- They have any items where the "Status" is 'Active'
- Drivers are included if
- The driver record has not been edited in the last two years AND
- Linked quotes, contracts and items have not been edited in the last two years
Standard Query
The standard query is shown below.
A 'field alias' for 'driver_id' is required in the query, else the query cannot be allocated to the scheduler job.
In the query below the 'field alias' is seen as "SELECT d.driverid as driverid, d.created,β¦"
If you want to change the query to suit your business, contact Catch-e Support to raise a task for your requested changes.
## Query Recordselect * from gb_queries where name = 'Driver deidentification query';## QuerySELECT d.driver_id as driver_id, d.created, d.last_edit, date_format(if(d.last_edit = '0000-00-00', d.created, d.last_edit),'%Y-%m-%d') as driver_date, COUNT(c.contract_id) AS contracts, COUNT(epi.employee_package_item_id) AS items, DATE_FORMAT(MAX(st1.last_edit), '%Y-%m-%d') AS last_edit_recordsFROM fm_drivers AS d LEFT JOIN fm_contracts AS c ON c.driver_id = d.driver_id AND c.suspend_date = '0000-00-00' LEFT JOIN sp_employee_package_items AS epi ON epi.driver_id = d.driver_id AND epi.status_flag IN ('active') LEFT JOIN (SELECT q.driver_id, 'quotes' AS origin, MAX(q.last_edit) AS last_edit FROM qt_quotes AS q GROUP BY q.driver_id UNION SELECT c.driver_id, 'contracts' AS origin, MAX(c.last_edit) AS last_edit FROM fm_contracts AS c GROUP BY c.driver_id UNION SELECT epi.driver_id, 'items' AS origin, MAX(a.timestamp) AS last_edit FROM sp_employee_package_items AS epi INNER JOIN gb_audit AS a ON a.record_id = epi.employee_package_item_id INNER JOIN gb_audit_fields AS af ON af.audit_field_id = a.audit_field_id AND af.table_name = 'sp_employee_package_items' GROUP BY epi.driver_id) AS st1 ON st1.driver_id = d.driver_idWHERE c.driver_id IS NULL AND epi.driver_id IS NULLGROUP BY d.driver_idHAVING driver_date <= DATE_SUB(CURDATE, INTERVAL 2 YEAR) AND last_edit_records <= DATE_SUB(CURDATE, INTERVAL 2 YEAR) OR driver_date <= DATE_SUB(CURDATE, INTERVAL 2 YEAR) AND last_edit_records IS NULL;