Eggplant AI API Endpoints
You can retrieve and manage the following data by using the advanced Eggplant AI API endpoints:
Model related data
- Agents that connect the Eggplant AI server to system under test (SUTs) via Eggplant Functional
- Models and sub models that represent your application
- Coverage models that represent your bespoke coverage definitions for temporal path depth and variable cross depth
- Defect reports that provide a list of failed model test runs
- Run reports with history of model test runs including timings and logs
- Coverage reports that provide a glimpse of what areas of your model are visited by the Eggplant AI engine
- Test cases for all your user defined journeys through your model
- Test runs to show which test cases have been hit
- Tags that are used to categorize various parts of your model to help with bug hunting
- Insights that combines data from third-party providers and calculates scores to help you predict where you need to focus to improve your application quality
Global data
- Generate authentication tokens to access the protected endpoints
- Manage users of Eggplant AI
- Use groups to share models between users
- Generate licenses for accessing Eggplant AI and running multiple tests in parallel
- Provide usage statistics
- Ping for testing if the API is running
Authentication
Most endpoints in the Eggplant AI API require authentication. Therefore, you must obtain an access token by making a POST request to the /auth endpoint passing a valid username and password from an enabled Eggplant AI user account. Typically, access tokens last for 7 days, and when they expire, you will get a 401 Unauthorized response from the endpoints that are user-restricted. When this happens, simply request another access token from the /auth endpoint. A typical response is as follows:
To find out when a token expires, you can use the expires_in value of the response. This indicates when the access token will expire in milliseconds (604800 seconds = 7 days).
Authorization
User restricted endpoints require a valid access token to be set in an Authorization header in all API requests. The format of the Authorization header is bearer {access token}. Some endpoints like the model related endpoints require you to have the correct permissions to access them. Permissions are determined by your group associations in Eggplant AI, and models are associated with groups.
On registering with Eggplant AI, users are assigned to their own individual group, which is named identical to their email addresses.
There are two user types: A regular user and an admin user. Admin users have access to additional endpoints that regular users don’t. These endpoint types are used for managing all users, all models, and other global settings. Admin users can also create additional groups to enable model sharing.
HTTP Methods
Use the following HTTP methods to send requests to the Eggplant AI API endpoints:
- GET for requesting data
- POST for creating new records
- PUT for updating records
- DELETE for deleting records
Endpoints
The documentation for all the advanced Eggplant AI API endpoints is automatically generated by Swagger. It allows you to determine how to use each of those endpoints to extract data. In addition, it provides the URLs, HTTP methods, headers, and body parameters that you need to pass to the endpoints and a list of possible responses.
See the API documentation link below, for available methods.