Labstats Support
  1. Home
  2. LabStats API
  3. Getting Started with the LabStats API

Getting Started with the LabStats API

The LabStats API makes it possible to share LabStats data with secondary applications and tools. You can integrate data collected by LabStats into your own systems and processes (such as Power BI or other business intelligence tools) to achieve new capabilities, automate workflows, and more. 

Related: How Manhattan College Uses LabStats API

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

There are two ways to create API keys within LabStats:

  1. API Management Method: Use the API Management page under Admin > External Systems
  2. BI Reports Method: Follow the prompts under either Computer Usage or Software Usage on the BI Reports page.

Please note that these methods will result in different permissions being assigned to your API key, specifically whether or not the key can access the three historical endpoints. We are working on updating this behavior so that these permissions are configurable.

API Management Method

Use the API Management page to create a key when you do not need the three history endpoints for your application.

  1. Navigate to Admin
  2. Click on External Systems, then click API Management
  3. Click on Create New API Key
  4. Specify a descriptive purpose for the API key
  5. Select the types of data that the key can be used to access
  6. Select the appropriate Access Level
  7. Restrict requests (if desired)
  8. Check the box to confirm that you understand the risks and responsibilities associated with API usage
  9. Click Save

 

BI Reports Method

Use the BI Reports page to create a key when you need any or all of the three History endpoints for your application.

  1. Navigate to BI Reports
  2. Click on either one of the Get Started buttons under Create your own on the right side of the BI Reports page
  3. Under Step 2: Authorize Data, click Select API Key. Select one of the displayed keys if compatible, or click on Create New API Key
  4. Specify a descriptive purpose for the API key
  5. Select the types of data that the key can be used to access
  6. The Read Access Level has been pre-configured here.
  7. Restrict requests (if desired)
  8. Check the box to confirm that you understand the risks and responsibilities associated with API usage
  9. Click Save

For either method, 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.

Related: LabStats API

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:

Page Limits

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.

Caching

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:

 

North America: https://api.labstats.com

Australia, New Zealand, & Asia: https://sea-api.labstats.com

Europe: https://weu-api.labstats.com

Have questions? Contact support@labstats.com.

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support