Fleet API Webhook Overview
Overview
The Fleet API Webhook allows customers to receive real-time vehicle data at their desired endpoint.
Webhook Types
We offer the following types of webhooks.
- Periodic Data: Information about periodically occurring events from the vehicle (e.g., current speed, location)
- Event Data: Vehicle events triggered by specific actions (e.g., door open, impact detection)
Pre-requisite
The following preparations are required to use Webhook.
- You must obtain a Client ID and Client Secret through the Pleos Playground.
- You must register the webhook in the vehicle management system.
Registering a Webhook
Refer to the Getting Started - Start Webhook section to register a webhook.
Webhook Operation Method
The Fleet API Webhook operates by sending real-time HTTP requests to a pre-registered endpoint when an event occurs in the vehicle or vehicle management system.
-
Webhook Event Subscription
A webhook subscription is registered for specific vehicle or FMS events through the Fleet API. -
Event Occurrence
When a vehicle state change (e.g., door open, impact detection) or an FMS event (e.g., trip creation, vehicle information update) occurs, the Fleet API sends the event through a webhook. -
Sending HTTP Request
The Fleet API sends an HTTP request containing the event data to the pre-registered endpoint. -
Processing Callback Response
The request is considered successful if the endpoint returns a valid response (e.g.,200 OK
).
If the response is invalid or no response is received within a certain time, the request is considered a failure and will be retried up to the maximum retry count.
Setting Custom Headers
If additional header information such as authentication is required at the user's endpoint receiving the webhook, users can configure custom headers.
Registering Custom Headers
When registering a webhook through the vehicle management system, the user can configure custom headers as follows.
-
Navigate to the Webhook Management Page in the Vehicle Management System
You can create a new webhook or modify an existing one. -
Register Required Custom Headers
Enter the headers to be included in the webhook request in Key-Value format. -
Final Webhook Registration
Once setup is complete, the specified headers will be included when sending webhook requests.
Example of Custom Header Registration
Custom Header Name | Value | Description |
---|---|---|
Authorization | Bearer your_token_here | Bearer Token for API authentication |
X-Custom-Header | custom_value | Additional user-defined header value |
This allows the user's endpoint to handle authentication and additional data processing.
Others
The Webhook response must be provided in a format supported by the Fleet API to ensure proper usage. Refer to Fleet API Webhook callback response to compose the callback response.