- Overview
- About Flex5 API Keys
- Request Access
- Generating Flex API Keys
- Using Flex5 API Keys
- API Request Limits
Overview
The Flex5 API is currently in a “Beta” status. This means you need to request access & agree to conditions of usage which are fully defined in our API Terms of Service. Please go to Main Menu > Integrations > API > API Access Terms of Service to review.
About Flex5 API Keys
The Flex5 API is secured from unauthorized use by restricting API calls to users that provide proper authentication credentials. Authentication is in the form of an API Key. There are also request limits that are associated with your Flex Plan. The request limits are as follows:
Flex Enterprise: 100,000 monthly / 10,000 daily / 2,000 hourly
Flex Lite: 1,000 monthly / 100 daily / 20 hourly
This guide will show you how to create, revoke, reinstate, and use your API Key with your Flex5 account.
Request Access
The first step to getting started with the Flex5 API is to Request Access. If your Flex account is not currently authorized you will need to fill out the Flex5 REST API Access Request form through your Flex instance.
- From Flex5 Desktop go to Main Menu > Integrations > API .
- On the right side of the page click Request Access. Please fill out the required fields and submit the form for review. We greatly appreciate your patience while we review your request. Typically approval takes 1-2 business days.
- Once approved, you will need to thoroughly review and agree to the Terms & Conditions the next time you visit the Flex5 API page. It will auto display on the API page until you have accepted the terms. After that, you are ready to start generating Flex API Keys!
Generating Flex API Keys
A new API Key is a unique identifier that authenticates requests associated with your work to track usage. API Keys are active until revoked. Be sure to store your API Key in a safe place.
To generate an API Key:
- From the API page ( Integrations > API ) click the Add API Key icon at the bottom of the page. Enter a Description and click OK.
- You can now copy the API Key to your clipboard by clicking the Copy API Key to Clipboard button in the API Key column.
Using Flex5 API Keys
Accessing Your Own API Documentation
Our API Documentation tool is Swagger UI. You can browse your own Swagger UI by using the template URL below.
Substitute in your own subdomain for "yourflexsite": https://yourflexsite.flexrentalsolutions.com/f5/swagger-ui.html
You can experiment live in Swagger UI by authorizing with your API Key.
-
In Swagger UI, click the “Authorize” button.
-
Paste your API Key into the dialog that pops up. Click “Authorize” in the dialog. Now you are all set to begin trying out API’s right from Swagger UI!
Writing Your Own Code
It is important to treat your API key like a password & store it in a safe place outside your Git repository. Your code should look up the key from an environment variable or some other secure secret mechanism. As you would expect, you can write code against our API in the language of your choice. To authorize your calls, simply set the X-Auth-Token header with your API Key. Your API calls will have the same permissions & access as the Flex User that generated the key. Access will not expire unless you revoke the API Key or lock the Flex User.
Understanding Usage of Flex5 API’s
You will not be able to fully understand the usage of Flex5 API’s using only the Swagger UI documentation. It does not document all the request parameter codes & JSON body structures. Since the Flex5 UI uses the Flex5 API, you can use your browser's network tool to observe how APIs are being used, query parameters passed to the API, and JSON data being sent and received to and from the API.
Using Chrome as the browser, visit your Flex site and log in. Now open Chrome DevTools by going to Chrome's Menu → View → Developer → Developer Tools. Open the Network tab at the top. You'll now be able to watch the API calls as you use the Flex5 web app. Navigating to areas in the Flex5 web app that are related to your areas of interest in the API will serve as a usage template for coding your own API calls.
Revoking/Reinstating Flex API Keys
For security purposes, it is important to always revoke unused, lost, or compromised API keys. A revoked API Key will deny request access to the Flex5 API. To revoke an API Key, follow the steps below starting from the API page ( Integrations > API).
- Use the checkbox to select the API Key you would like to revoke.
- Now click the Revoke API Key(s) icon at the bottom of the page.
To Reinstate an API Key:
- Use the checkbox to select the API Key you would like to reinstate.
- Now click the Unrevoke API Key(s) icon at the bottom of the page
API Request Limits
The Flex5 API enforces request limits. These limits are aggregated across all API Keys. For example, if a customer has four keys, the limit is split between all four keys.
The standard monthly limit is 100,000 requests. This can be increased to 250,000 for an additional fee.
In addition to monthly limits, API keys have hourly and daily limits.
- Daily limit is the monthly limit / 10 (resets on the day of month change in UTC time)
- Hourly limit is the monthly limit / 50 (resets on every hour change)
There is also a concurrency limit of 30 simultaneous requests per customer.
For all these scenarios, the API will send back a 429 HTTP status code.