EHS API
API's (Application Programming Interface) enable two software components to communicate with each other using a set of definitions and protocols.
For example, the GPS’s software system contains daily traffic, route and accident data. The mobile application on your phone “talks” to this system via APIs and shows you traffic updates on your phone.
About Frontline EHS API's:
Frontline Data Solutions leverages API's to create data model's that put your site's information into charts and data visualizations.
To Get Started:
1. Reach out to Frontline support to generate you API Key · Email: support@fldata.com · Phone: (281) 313-8200
2. Retrieve your API Key · Admins can access API Key info from their site under LMS > Settings > EHS API · Reach out to Frontline support for API Key
3. Retrieve Base URL and API Swagger Link · https://ehsapi.fldata.com/api/v1 · https://ehsapi.fldata.com/swagger/index.html
4. Authorize the API · Option 1: Add query parameter “/?ApiKey=[APIKEY]” in the API URL (commonly used to pull data in a browser) · Option 2: Add Authorization header in the API call with value “Bearer [APIKEY]”
5. API Calling & Filtering · API Filters PDF · Ex: https://ehsapi.fldata.com/api/v1/Divisions/?APIKey=[APIKEY].
a. API Filters attached
API Requirements:
- The API MUST be versioned.
- The API MUST be fully documented.
- All API requests should be Restful and MUST NOT require a web server session.
- Clients MUST authenticate to be able to use the API.
- Need to identify the type of authentication to be used. Once this is identified, we will need to further flesh out the implementation.
- If API KEYs are used then frontline should be able to revoke and/or re-generate keys at anytime.
- All API results will be returned in a JSON format.
- Dataset Paging:
- The API MUST implement a paging methodology for large datasets
- Endpoints that allow for paging MUST:
- allow the user to set the number of items per page.
- allow the user to choose the page to return
- there MUST be an API imposed maximum on the number of records can be returned per page. If the user sets a value higher than the max, the API will only return the max records.
- Error Handling
- All HTTP responses should standard HTTP Response codes where possible.
- Responses messages should be helpful to the API consumer so that they can fix the problem themselves
- All Unhandled exceptions (http code 5XX) MUST be logged to a central location with error details:
- Raw API Request
- Authenticated User
- Error Message and Stack Trace