Using Swagger to query the API
All eHour's endpoints are documented in Swagger, an interactive user interface that allows developers to query the API directly from the browser. In this article, we'll walk you through how to use Swagger to get a list of all users.
Prerequisites
Before you can create a project using the eHour API, you need an API key. Read the article "Getting Started with the API" for more information about authorization.
Steps to Use Swagger
To use Swagger to query the eHour API, follow these steps:
- Open your browser and navigate to https://ehourapp.com/api/doc
- Click the "Authorize" button to enter your API key in the "Value" field.
- All endpoints are grouped by entity: team, user, client, project, task, assignment, report, etc.
- Navigate to the User group and click the /api/v1/users endpoint to expand its details and view its parameters.
- Click "Try it out!".
- Enter a query to filter the list of users or leave it empty to return all users.
- Click "Execute"
- Review the API response.
That's it! You've successfully used Swagger to query the eHour API's /api/v1/users endpoint.