It is possible to interact with Identity Panel API REST endpoints as described in this collection of articles, using an IDE of choice. A common use case is to generate reports using Postman. This article assumes the pre-requisites have been configured before setting up the Postman Environment and the Postman collection to support loading a report.
Pre-requisites
- Basic Authentication credentials have already been configured in Identity Panel.
- Postman has been installed and there is a basic understanding of Postman concepts, specifically Collections and Environments.
- A suitable report is available to test against. A handy report for testing and assisting retrieval of necessary Report Ids is available as an attachment to this article (IdP Reports).
Postman Environment
Create a Postman Environment to store variables pertinent to the Identity Panel instance in use. This eases portability of the configuration between [Identity Panel] instances. The values are sourced when setting up the Basic Authentication user and from the Install Service settings page of Identity Panel.
| Variable Name | Type | Source |
|---|---|---|
| idpHost | default | Install Service settings |
| idpTenant | default | Install Service settings |
| authUser | default | Extensions/Basic Authentication |
| authPassword | secret | Extensions/Basic Authentication |
| X-API-Key | default | Install Service settings |
Postman Collection - Load Report
- Create a new collection for Identity Panel API calls (or re-use an existing one if available).
- The Authorization scheme, Basic Auth, will be specified at the Collection level. The authUser and authPassword variables created earlier will be utilized.
- Create a new request in the collection, specifying GET as the method. Apply a suitable name for the request, in this example the report "IdP Reports" is to be queried so the request is named "Reports - IdP Reports".
- Authorization settings should be inherited from the parent, i.e. the collection defined earlier.
- The Identity Panel API key, and depending on platform, tenant Id headers are required in addition to setting the Authorization scheme.
- The URL for the GET request calls the api/reports/{Id} endpoint, using variables to generate the URL eases Collection/Request portability. In this example the variable, idpReportsId, corresponds to the sample report attached to this article and referenced in the pre-requisites. Optionally the query parameters can be set as variables too. In common scenarios setting the limit parameter to 0 is desirable to retrieve the entire report data set.
- Execute the request (click Send) to see results returned in the response body. In some cases an HTTP 206 (Partial Content) response will be received indicating the report is still being built.
Re-submitting the request until an HTTP 200 response is received allows the report to be built and results returned.
- If the entire dataset is not required a non-zero limit should be used. The "Count" returned will still indicate the expected total record count.
- Optionally, parameters (names and values) can be entered in the Query Params config for a request.
Postman Collection - Clear Report Cache
The web interface for reporting allows a user to "Clear cache and refresh report". To achieve the same via API calls one needs to call the api/reports/clear/{reportId} endpoint.
- Similar to setting up a new request for loading a report, configure a new request, "Reports - Clear Cache - IdP Reports", using the same Authorization and Headers configured earlier. The HTTP method for this endpoint is POST so the request is slightly different. There are no query parameters for this endpoint.
- The expected response is HTTP 204 (No Content).
Comments
0 comments
Please sign in to leave a comment.