In order to use the API, you must have a basic understanding of web development and have obtained a valid API key with the appropriate permissions. You must also be familiar with and follow the LabStats API Best Practices.
API Key Creation
- Navigate to Admin
- Click on External Systems, then click API Management
- Click on Create New API Key
- Specify a descriptive purpose for the API key
- Select the types of data that the key can be used to access
- Select the appropriate Access Level
- Restrict requests (if desired)
- Check the box to confirm that you understand the risks and responsibilities associated with API usage
- Click Save
The data and access level settings determine which endpoints can be called using this API key. Make sure you have the correct permissions to access the data you need. For an in-depth list of the endpoints, their permissions and data access levels, visit the Documentation and Testing Sandbox.
Documentation and Testing Sandbox
The Documentation and Testing Sandbox allows you to send test requests to the API so that you can familiarize yourself with it. You can test different parameters and view the actual LabStats’ data associated with your organization.
In order to improve the reliability and general accessibility of the API, we employ page limits, rate limits, and caching.
Be aware of the following terms and limits as you call the API:
Many endpoints have the possibility of returning large amounts of data which, in some cases, would be too large to safely process at once. Using paging techniques you can still use the API to obtain large amounts of data in a safe manner. These endpoints have a Page Limit which refers to the maximum number of records which can be returned at one time. Each response from endpoints with page limits will include an “additional_pages” property which indicates if additional records are available. If the response was limited, you can then make additional requests to obtain the next set of records (the next page). Use the “last_id” property as the “after_id” parameter in the next query. The API Documentation identifies paged endpoints and their page sizes.
Endpoint Rate Limits
Some endpoints may have a Rate limit which restricts the number of requests that can be made to that endpoint within a certain period of time. This requires you to spread your usage out so that it doesn’t become too taxing. The API Documentation identifies rate limited endpoints and their restrictions.
Organizational Rate Limits
In addition to individualized endpoint rate limits, LabStats also imposes an Organizational Rate Limit which restricts the total number of requests that can be made to all endpoints within a certain period of time. As with individual endpoint rate limiting, this requires you to spread your usage out so that it doesn’t become too taxing. The current organizational rate limit is 250 requests per minute, however, this limit is subject to change.
Many endpoints employ caching to maintain proper operation of the API, but it also supports its use by a larger number of distributed users or applications and helps alleviate rate limiting restrictions. This is particularly helpful for use with mobile applications and websites. With this in mind, calling the same endpoint with the same parameters and filters multiple times within the caching period will yield the same cached result. As a general rule, endpoints providing real-time data will be cached for a shorter time while endpoints providing data that doesn’t change as often will be cached longer. The API Documentation identifies cached endpoints and their durations.
API Documentation & Testing
Comprehensive API documentation is available which lists all available endpoints and provides information about their parameters, filters, caching details, rate limit restrictions, and expected responses. This API documentation can also be used to test your organization’s API directly.
To access this documentation and testing resource, use the appropriate link below based on your organization’s location:
Contact Support if you are unsure which link to use, or if you have any other questions regarding the LabStats API.