This API permits you to edit a driver event.

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 DriverEvents:Update.

Note: Authenticate with the API before running this method.

HTTP Method

Use the HTTP Method 'PATCH' for consuming this web service.

URL Examples

https://api.test.catch-e.com/fm/driver-events/{driver_event_id}

https://api.test.catch-e.com/fm/driver-events/101897

Body (JSON)

JSON

Field Format

Notes

Mandatory

driver_event_id

string

Driver event ID to update

Yes

driver_id

string

Driver ID (the driver the event is associated with)

No

driver_event_code_id

string

Valid event code ID for the type of event

Yes

event_date

string (date)

Effective date of the event. Format: YYYY-MM-DD or 0000-00-00 to leave blank. If not passed, system date is used

No

event_value

string

Event value. Will be ignored if event_value_id is provided or fails validation

No

driver_event_value_id

string

Driver event value ID from configured list. Use getDriverEventValues API. Conditional based on event code configuration

Conditional

description

string

Event description. Will be ignored if event_description_id is provided or fails validation

Yes

driver_event_description_id

string

Driver event description ID from configured list. Use getDriverEventDescriptions API. Conditional based on event code configuration

Conditional

driver_event_action_id

string

Event action ID. Use getDriverEventActions API. Default value: 100000 if not passed

No

due_date

string (date)

Due date for the event. Format: YYYY-MM-DD

No

completed_flag

string

Event completion status. Values: yes, no. Default used if not passed

No

attachment_id

string

Link a driver event to an attachment ID

No

user_id_edit

string

Last edited by user ID

No

last_edit

string

Last edit timestamp

No

status_flag

string

Event status. Values: active, deleted

No

JSON Sample

{ "driver_event_id": "101897", "driver_event_code_id": "100001", "event_date": "2024-05-23", "event_value": "Testpatch", "description": "1", "driver_event_action_id": "100001", "due_date": "2024-07-09", "completed_flag": "yes", "status_flag": "active" } 

Response Details

Validation Message

Comments

200 OK

The request was successful and the driver event has been updated

403 - Forbidden

You do not have permissions for this request

422 - Unprocessable Entity

Validation failed - see error examples for specific issues

Successful Response Example

{ "driver_event_id": "101897", "driver_id": "101399", "driver_event_code_id": "100001", "event_date": "2024-05-23", "event_value": "Testpatch", "description": "1", "driver_event_value_id": null, "driver_event_description_id": null, "driver_event_action_id": "100001", "due_date": "0009-07-02", "completed_flag": "yes", "attachment_id": null, "user_id_edit": "11244", "last_edit": "2024-05-23 04:23:10", "status_flag": "active", "_links": { "self": { "href": "https://api.test.catch-e.com/fm/driver-events/101897" } } } 

Error Response Examples

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 Unprocessable Entity - Invalid Attachment ID

{ "validation_messages": [ { "attachment_id": { "noRecordFound": "No record matching the input was found" } } ], "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

Attachment ID not found or is not valid.