Legacy Documentation for Obsolete APIs
Lytx provides fleet telematics to help companies manage their fleet vehicles. Lytx APIs provide clients the ability to retrieve their data from their installed devices.
Requirements
- Accept our Terms of Use.
- Create or obtain an API key from a registered Lytx Account user.
The Basics of the API
- The APIs aim to be RESTful. The API endpoints attempt to conform to many of the design principles of Representational State Transfer (REST).
- Lytx APIs use the JSON data format for responses.
- The endpoint URL must include the endpoint name and path, the company's pod, and any parameters.
https://api.**{pod}.{location}**.lytx.com/**{name}/{path}?{param1}&{param2}**
Sample:
https://api.05.sd.lytx.com/ecm/vehicles?page=1&pageSize=10
To compose a request, include the endpoint URL, parameters, your API key, and the accept type for JSON responses.
curl --request GET \
--url 'https://api.05.sd.lytx.com/ecm/vehicles?pageSize=10&page=1' \
--header 'accept: application/json' \
--header 'x-apikey: {API key}'
Pods
Each company is assigned to one of several pods. The podded structure helps maintain stability and performance for all Lytx companies.
The company's pod must be specified in the endpoint URL. It's also needed to successfully log in and create API keys. If you have an API key already and you want to try out the APIs, the correct pod is needed to use the API key.
To use the APIs, obtain the correct pod from your Lytx representative. In the developer portal, select the correct pod in the top-left corner.
Authorization
To use the API, you need to obtain an API key. This must be created in the Lytx Developer Portal by a user with Lytx account credentials.
Creating API Keys
- In Lytx Developer Portal, go to Login at the top. Log in using Lytx account credentials.
- On the Dashboard, press 'Create API Credential'. This generates the API key string.
After the key is generated, it's listed on the Dashboard. You may also edit or delete the key from here.
API Key Permissions
The API key provides the same data access as the user who created the key.
The user's access is controlled by multiple factors. To access a specific app's data, the user's company must have purchased service for an associated product and the user must be assigned a role that grants them access to that app as well.
Their user role is also linked to a specific group or subgroup within the company's group hierarchy. They may access data from their group and all subgroups underneath it. They may also have different roles in different groups and this would increase their data access.
Given Group A with Subgroup B and Subgroup C, if the user is assigned a role in Subgroup B, they can access that data but not the Subgroup C data. However, if the user is assigned to Group A, they can access data from both Subgroup B and Subgroup C.
Best Practice: For full access to a company's available data, Lytx recommends creating a user account with the 'Full Access' role at the company's highest level 'Root' group. Use this account to create an API key.
Trying Out the API
The Lytx Developer Portal allows you to try out the APIs to see sample calls and responses. The portal may be accessed without logging in. However, an API key is needed to see calls and responses.
After obtaining an API key, select the desired API from the Catalog. Then press 'Authorize' at the top and enter the API key.
To try out an endpoint, select the desired endpoint, enter desired parameters, and press Execute. The sample call and response is then generated.
Contacting Technical Support
For troubleshooting support, please contact the Lytx Technical Support Center by emailing: support@lytx.com.