Skip to main content

Getting Started

Getting Started

The Fleet API provides a REST API and Webhook, making it easy for users to manage their fleet. Users can freely integrate essential vehicle and device information, real-time data, vehicle control, driver management, vehicle maintenance, and anomaly detection into their desired platforms in their preferred ways.

Getting API Endpoint Information

Endpoint information is provided by your representative after signing a Pleos Fleet usage agreement. The roles of each endpoint are as follows:

  • FLEET_API_GATEWAY_HOST: The gateway host used to obtain the token required to access the Fleet API
  • FLEET_API_HOST: The host for the Fleet API

Getting Started with REST API

Follow the steps below to work with Fleet API elements using the REST API.

  1. Obtain a Client ID and Client Secret from the Pleos Playground.
  2. Apply for Fleet API usage approval.
  3. Once approved, you can use the REST API.

Obtain an Authentication Token

Fleet API supports Client Credentials Grant authentication. Request a token using your previously issued Client ID, Client Secret and Project ID.

Request Endpoint Information
MethodEndpoint
POST${FLEET_API_GATEWAY_HOST}/auth/client/token
Request Body (JSON)
{
"client_id": "your-client-id", // Issued Client ID
"secret": "your-secret", // Issued Client Secret
"identifier": "your-project-id", // Issued Project ID
"regenerate_token": false // Specifies whether to reissue the token (if true, the existing valid token is invalidated and a new one is issued instead)
}
Request Response
AccessToken: {Your.Access.Token}, // Issued Access Token
AccessTokenExpireInSecond: 3600 // Time until the issued Access Token expires (in seconds)
Fleet API Request Example

Use the Access Token issued above to call the Fleet API. Below is an example of retrieving a list of vehicles using the Fleet API.

curl -X GET "${FLEET_API_HOST}/developers/api/vehicles?page=1&size=20" \
-H "x-42dot-client-id: Bearer Your.Access.Token"

You can now fully utilize the elements provided by the Fleet API!

For more details on the REST API provided by Fleet API, see Fleet REST API Overview.

Getting Started with Webhook

If you want to receive real-time Fleet events, you can use the Fleet API Webhook.

  1. Once approved for Fleet API usage, you can access the Settings > Webhook menu in Pleos Fleet. Access this menu.
  2. Register a new Webhook using the Webhook Registration button at the top-right.
  3. Select the desired Webhook event.
  4. Enter the endpoint where you want to receive data when an event occurs.
  5. (Optional) Depending on the type of endpoint, you may need to use a custom header. Register the required custom headers.
  6. Once all information is entered, click the [Register] button to register the Webhook.

You can now receive your desired Fleet events in real time!

For more details on Webhook events provided by the Fleet API, refer to the Fleet API Webhook Overview.