Skip to main content
Driver / Events

PatchDriverEvents

Overview

This API permits you to edit a given list of driver events.

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.

Authentication

Authenticate with the API before running this API.

HTTP Method

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

URL Examples

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

Body (JSON)

Key

Format

Notes

Mandatory

driver_event_id

string

Pass the "driver_event_id" of the driver event you want to update.

Yes

driver_id

string

Pass the driver_id of the driver you are creating an event against.

No

driver_event_code_id

string

Pass a valid event_code_id for the type of event you want to create.

Yes

event_date

string

Pass the effective date of the driver event you are creating.

If no date is passed, the system date will be used.

If you want to set the date to be blank, you can pass a date of '0000-00-00'.

No

event_value

string

An event value can be passed. This will be ignored if there is an event_value_id or the event_value_id validation fails.

No

driver_event_value_id

string

Pass a driver_event_value_id if the event uses a configured list of event values.

Use the API getDriverEventValues to get a list of available values.

You do not need to pass a value if there is no configured list or you want to use the stored default value.

conditional

description

string

Pass an event description if the event does not have a stored list of descriptions.

This will be ignored if there is an event_description_id or the event_description_id validation fails.

Yes

driver_event_description_id

string

Pass the driver_event_description_id if there is a configured list of event descriptions.

Use the API getDriverEventDescriptions to get a list of available descriptions.

You do not need to pass a value if there is no configured list or you want to use the stored default description.

conditional

driver_event_action_id

string

Pass an action from the actions stored in [fm_driver_event_actions].

Use the API getDriverEventActions to get a list of available actions.

If no action is passed, the default value is 100000. No

due_date string

No

due_date

string

Pass the due date of the contract event you are creating if required.

No

completed_flag

string

If not passed, the default setting is used. This is stored as "Yes", "No".

No

attachment_id

string

Link a Driver Event to an Attachment ID.

No

user_id_edit

string

Last Edit By (User ID)

No

last_edit

string

Last Edit timestamp

No

status_flag

string

Event Status ('active','deleted')

No

JSON Sample

[ { "driver_event_id": "101879", "driver_event_code_id": "100006", "event_date": "2024-05-17", "driver_event_action_id": "100001", "status_flag": "active" }, { "driver_event_id": "101878", "driver_event_code_id": "100007", "event_date": "2024-06-20", "driver_event_action_id": "100000", "status_flag": "active" } ]

Response Details

Validation Message

Comments

200 OK

The request was successful request.

403 - Forbidden

You do not have permissions for this request

422 - Unprocessable Entity

Validation failed - see error examples for specific issues

Successful Response Example

{
    "_links": {
        "self": {
            "href": "https://api.test.catch-e.com/fm/driver-events/"
        }
    },
    "_embedded": {
        "fm_driver_events": [
            {
                "driver_event_id": "101879",
                "driver_id": "101313",
                "driver_event_code_id": "100006",
                "event_date": "2024-05-17",
                "event_value": "",
                "description": "",
                "driver_event_value_id": null,
                "driver_event_description_id": null,
                "driver_event_action_id": "100001",
                "due_date": "0000-00-00",
                "completed_flag": "no",
                "attachment_id": null,
                "user_id_edit": "11244",
                "last_edit": "2024-05-17 05:55:41",
                "status_flag": "active",
                "_links": {
                    "self": {
                        "href": "https://api.test.catch-e.com/fm/driver-events/101879"
                    }
                }
            },
            {
                "driver_event_id": "101878",
                "driver_id": "101313",
                "driver_event_code_id": "100007",
                "event_date": "2024-06-20",
                "event_value": "",
                "description": "",
                "driver_event_value_id": null,
                "driver_event_description_id": null,
                "driver_event_action_id": "100000",
                "due_date": "0000-00-00",
                "completed_flag": "no",
                "attachment_id": null,
                "user_id_edit": "11244",
                "last_edit": "2024-05-17 05:55:41",
                "status_flag": "active",
                "_links": {
                    "self": {
                        "href": "https://api.test.catch-e.com/fm/driver-events/101878"
                    }
                }
            }
        ]
    },
    "total_items": 2
}

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

{
    "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.

Was this helpful?

Still need help? Ask the team