The Fleet Tracker Open API enables you to retrieve Fleet Tracker data programmatically using a REST interface. The API provides predefined calls for retrieving specific information. You can format the returned data to either JSON or XML. Using the API provides flexibility and allows you to integrate the data collected by the Fleet Tracker with your existing systems.
To make calls to the API, make sure that you have a valid API user account. A super administrator can create API user accounts from the Fleet Tracker web portal. When API users are created, the super administrator must specify the credentials and group access of the users. For more information on adding API users, see Configuring user access.
Calls to the Open API are made in HTML in the following format:
Where:
is the host name, IP address, or domain name of the Fleet Tracker server.
specifies whether the return data is formatted to either JSON or XML.
is the API call that determines what data is returned.
is the name of the parameter for the API call.
is the value of the parameter.
The Open API expects seven calls from the client. When the client initiates any of the seven calls, it returns with Fleet Tracker data in the specified format. All calls require authentication except for the and calls. The Open API follows the group access that is configured per API user. If a user does not have group access, then the group and its device information are not returned for any of the user’s API calls.
Method | Return value | Parameters | Example HTML | Notes |
|---|---|---|---|---|
This call returns a list of client details, one per client. Each record includes the following:
| None | http://<server>/com.lexmark.lfm.api/<format>/client | If there are no clients, then no Client Details is returned. | |
This call returns a list of printer details. Each printer record includes the following:
|
|
| If clientid or clientname is invalid, or there are no devices for the specified client, then no Printer Details is returned. | |
This call returns a list of printer count record details. If the start and end times are specified, then there is one record per device that exists during the specified time range. The details are for the most recent rollup within the period. If a period is not specified, then the current device information is returned with one record per device. Each printer count record includes the following:
|
| http://localhost/com.lexmark.lfm.api/<format>/getprintercounthistoryforclient?clientid=eSF&starttime=01-01-18%2000:00:00&endtime=01-01-20%2000:00:00 | If clientid or clientname is invalid, or there are no devices for the specified client, then no PrinterCountRecordDetails is returned. | |
This call returns a list of printer status details. If the start and end times are specified, then there is one record per device for each rollup that occurred during the specified period. If a period is not specified, then the current device information is returned with one record per device. Each printer status record includes the following:
|
| http://localhost/com.lexmark.lfm.api/<format>/getprinterstatushistoryforclient?clientname=lexmark&starttime=01-01-18%2000:00:00&endtime=01-01-20%2000:00:00 | If clientid or clientname is invalid, or there are no devices for the specified client, then no PrinterStatusDetails is returned. | |
This call returns a list of printer supply details. If the start and end times are specified, then there is one record per supply for each rollup that occurred during the specified period. If a period is not specified, then there is one record per supply. Each printer supply record includes:
|
| http://localhost/com.lexmark.lfm.api/<format>/getprintersupplyhistoryforclient?clientname=lexmark&clientid=eSF&starttime=01-01-18%2000:00:00&endtime=01-01-20%2000:00:00 | If clientid or clientname is invalid, or there are no devices for the specified client, then no PrinterSupplyDetails is returned. |
The following sample Java code shows how to connect programmatically and authenticate to the Fleet Tracker Open API. The code depends on the Apache HTTP Client. Download the client from the Apache Server, and then add it to the JAR location at the appropriate class path.
The following JAR files are required to build the sample code:
commons-codec-1.6.jar
commons-logging-1.1.1.jar
fluent-hc-4.2.3.jar
httpclient-4.2.3.jar
httpclient-cache-4.2.3.jar
httpcore-4.2.2.jar
httpmime-4.2.3.jar
This code is specific to a Fleet Tracker server using HTTP and does not work with SSL.

