Reporting
You can use the reporting capability to generate reports containing user and MFA device details, using a number of device-related filters.
For example, you can generate a report listing all email devices or a report containing all of the devices whose phone number starts with a certain country code.
You can use synchronous requests to get back the matching data as entries in the JSON response or use asynchronous requests to have the data provided in a CSV or JSON file. Note that when using the synchronous approach, you may have to make multiple requests if there is a large amount of data.
The request for generating reports uses the dataExplorations endpoint:
|
MFA reports data model
| Property | Type | Required? | Mutable? | Description |
|---|---|---|---|---|
|
String |
Required |
Immutable |
The ID of the report template that should serve as the base for the report. Currently, the only supported value is db632bfd-7054-4bde-b108-a384aac2d513 |
|
String |
Optional |
Immutable |
How the results should be returned. The valid values are ENTRIES (get the results as a collection of entries in the response) and ASYNC_FILE (get the results in a CSV or JSON file). If the parameter is not included, ENTRIES is used. |
|
Array |
Optional |
Immutable |
The fields you want to include in the report. Array of name-value objects, where the name is always |
|
String |
Optional |
Immutable |
You can filter the results by: |
|
String |
Optional |
Immutable |
Set to "true" if you are using the |
Getting the report results
You can receive the report data as entries in the JSON response or as a file (CSV or JSON).
There are a number of ways you can get the report results. The recommended approaches for the most common scenarios are as follows:
-
For cases where you anticipate a fairly small number of records in the results:
-
Run a POST request using the
expandquery parameter. This will create thedataExplorationsobject and also return the results as entries in the response.{{apiPath}}/environments/{{envID}}/dataExplorations?expand=entriesFor more information on the use of the
expandquery parameter, refer to "Link expansion" under Conventions.
-
-
For cases where you expect a large number of records, but would like to receive them as entries in the body of the response:
-
Run a POST request to create the
dataExplorationsobject. -
Run a GET request with
/entriesin the URL:{{apiPath}}/environments/{{envID}}/dataExplorations/{{dataExplorationID}}/entries -
If there are too many results to include in one response, the
_linkssection in the response will include anextobject. Follow thenextlink, then using the same access token, run another GET request using the thenextlink as the URL. -
Continue until the response no longer includes a
nextobject.For more information on pagination, refer to Paging, ordering, and filtering collections.
-
-
For cases where you want to receive the results as a file:
-
Run the request to create a report and get the results as a file:
POST {{apiPath}}/environments/{{envID}}/dataExplorations. In the body of the request, make sure thatdeliverAsis set to ASYNC_FILE. -
The response to the report creation request will include a
statusfield whose value isIN_PROGRESS. -
Run the polling request
GET {{apiPath}}/environments/{{envID}}/dataExplorations/{{dataExplorationID}}, using the ID that was returned when you created the report, until thestatusfield in the response equalsSUCCESS. -
When the response contains the status
SUCCESS, it will also include a link for downloading a zipped csv file, a link for downloading a zipped JSON file, and a password for opening the zip files. Use this information to download and unzip the report. -
The report itself is cached for two hours, but the links are good for only five minutes.
-
If more than five minutes has elapsed from the time of the request that returned the links, get updated links by again running the request
GET {{apiPath}}/environments/{{envID}}/dataExplorations/{{dataExplorationID}}using the ID that was returned when you created the report. -
If more than two hours has elapsed since the report was created, run the report creation request again.
-