Manage Reports
    • PDF

    Manage Reports

    • PDF

    Article summary

    The following Britive API methods help you to manage reports and perform relevant operations.


    1. Retrieve Reports

    The GET method returns all the built-in reports in the system.

    GET{{url}}/api/reports?type=report

    Request Example

    An example GET request for retrieving all the built-in reports is shown here.

    curl --location --request GET '{{url}}/api/reports?type=report' \
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    An example response of the GET request for retrieving all the built-in reports is shown here.

    Status: 200 OK
    [
        {
            "reportId": "69l1AxCuVsBrh9TLI4ak",
            "name": "Profiles Assigned to Users",
            "description": "Provides information on profiles assigned to users",
            "type": "report",
            "subType": "csv",
            "supportedFilterTypes": null,
            "query": null,
            "parameters": null,
            "columns": [
                {
                    "name": "name",
                    "displayName": "Name",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 0
                },
                {
                    "name": "email",
                    "displayName": "Email",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 1
                },
                {
                    "name": "type",
                    "displayName": "Type",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": [
                        "User",
                        "ServiceIdentity"
                    ],
                    "order": 2
                },
                {
                    "name": "application",
                    "displayName": "Application",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 3
                },
                {
                    "name": "applicationStatus",
                    "displayName": "Application Status",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": [
                        "Enabled",
                        "Disabled"
                    ],
                    "order": 4
                },
                {
                    "name": "profile",
                    "displayName": "Profile",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 5
                },
                {
                    "name": "description",
                    "displayName": "Description",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 6
                },
                {
                    "name": "environment",
                    "displayName": "Environment",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 7
                },
                {
                    "name": "environmentStatus",
                    "displayName": "Environment Status",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": [
                        "Enabled",
                        "Disabled"
                    ],
                    "order": 8
                },
                {
                    "name": "mappedAccount",
                    "displayName": "Mapped Account",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 9
                },
                {
                    "name": "tag",
                    "displayName": "Tag",
                    "sortable": true,
                    "filterable": true,
                    "selectableValues": null,
                    "order": 10
                }
            ]
        }
    ]

    2. Run a Report

    The GET method runs a report, as indicated by the reportId parameter provided in the path. The method returns data in the JSON format. 

    The following parameters are used in the request:

    ParameterFormatDescription
    page{{page}}The page number to fetch data.
    size{{size}}A number between 1 and 100.

    The page has to be incremented in each API call to get the next set of records. This has to be repeated until no data is returned further.

    GET{{url}}/api/reports/{{reportId}}?page={{page}}&size={{size}}

    Request Example

    An example GET request for running a report is shown here.

    curl --location --request GET '{{url}}/api/reports/{{reportId}}?page={{page}}&size={{size}}' \
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    An example response of the GET request for running a report is shown here.

    Status: 200 OK
    {
        "reportId": "69l1AxCuVsBrh9TLI4ak",
        "data": [
            {
                "name": "User1",
                "email": "user1@company.com",
                "type": "User",
                "application": "Application1",
                "applicationStatus": "Enabled",
                "profile": "Administrator Profile",
                "description": "",
                "environment": "Development",
                "environmentStatus": "Enabled",
                "mappedAccount": "user1@company.com",
                "tag": ""
            }
        ]
    }

    3. Run a Report by applying Filters

    The GET method runs a report, by applying a filter on the columns associated with the report. Multiple filters can be applied as shown in the example. The method returns data in the JSON format.

    The following parameters can be used in the request:

    ParameterFormatDescription
    filterExample:
    application%20eq%20AWS%20and%20environment
    %20co%20378
    The filter used to filter the report.
    The filter contains one or more columns in the format column 1 and column 2, where op is one of the supported operators for the column. The most common operators supported by all columns are eq, sw and co. The filter should be URL-encoded as shown in the example.
    page{{page}}The page number to fetch data.
    size{{size}}A number between 1 and 100.

    The page has to be incremented in each API call to get the next set of records. This has to be repeated until no data is returned further.

    GET{{url}}/api/reports/{{reportId}}?page={{pageNo}}&size=100&filter=application%20eq%20AWS%20and%20environment%20co%20378

    Request Example

    An example GET request for running a report by applying a filter is shown here.

    curl --location --request GET '{{url}}/api/reports/{{reportId}}?page={{pageNo}}&size=100&filter=application%20eq%20AWS%20and%20environment%20co%20378' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    An example response of the GET request for running a report by applying a filter is shown here.

    Status: 200 OK
    {
        "reportId": "69l1AxCuVsBrh9TLI4ak",
        "data": [
            {
                "name": "User1",
                "email": "user1@company.com",
                "type": "User",
                "application": "Application1",
                "applicationStatus": "Enabled",
                "profile": "Administrator Profile",
                "description": "",
                "environment": "Development",
                "environmentStatus": "Enabled",
                "mappedAccount": "user1@company.com",
                "tag": ""
            }
        ]
    }

    4. Download Report

    The GET method downloads the data of a report in the CSV format. It returns all the data in a single API call.

    GET{{url}}/api/reports/{{reportId}}/csv

    Request Example

    An example GET request for downloading a report is shown here.

    curl --location --request GET '{{url}}/api/reports/{{reportId}}/csv' \
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    An example response to the GET request for downloading a report is shown here.

    Status: 200 OK

    Response in the CSV format

    "name","email","type","application","applicationStatus", "profile","description","environment","environmentStatus","mappedAccount","tag"

    "user1","user1@company.com","User","Application1","Enabled","Administrator Profile","","Development", "Enabled","user1@defaultdirectory382.oncompany.com",""








    Was this article helpful?