Get Reports List

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Get a list of reports that were generated.

Since: 3.8

Security: Requires a user with the Manage Reports role.

Notes: For Xray version 3.21.2 and above with Projects, a Project Admin with Manage Security Assets privilege can get a list of reports using this REST API in the scope of a project, by using the additional query parameter projectKey.

Usage: POST api/v1/reports

Usage Note: Setting pagination parameters are mandatory. The list of parameters include:

  • Direction: asc/desc

  • Page_num: Starting from 1 to any number of pages.

  • Num_of_rows: Starting from 1 to any number of rows that are included in a page.

  • Order_by: name, type, author, start_time, and status.

Sample Request

POST .../api/v1/reports?direction=asc&page_num=2&num_of_rows=10&order_by=name
{
"filters" : {
      "name" : "admin",  //substring
      "status" : ["completed"],
      "report_type":  ["license | vulnerability"| operational_risk”],
      "author" : "admin",    //substring
      "start_time_range" :  {
        "start": "2020-06-29T12:22:16Z",
        "end": "2020-06-29T12:22:16Z"
    },
      "end_time_range" : {
        "start": "2020-06-29T12:22:16Z",
        "end": "2020-06-29T12:22:16Z"
    }

  }

}     

Sample Response

{
    "total_reports": 100,
    "reports": [
        {
            "id": 1234,
            "name": "vul_report_1",
            "status": "completed", //running, pending, complete, aborted, failed
            "total_artifacts": 1000,
            "num_of_processed_artifacts": 10,
            "progress": 1,
            "number_of_rows": 10,
            "start_time": "1970-01-01T02:00:00+02:00",
            "end_time": "1970-01-01T03:00:00+02:00",
            "error": "error message in case of failure",
            "author": "user who initiated the report",
            "report_type": "license | vulnerability | operational_risk"
        }

    ]

}

Get Reports List in Projects

POST /api/v1/reports?direction=asc&page_num=2&num_of_rows=10&order_by=name&projectKey=<project_key
{
    "total_reports": 100,
    "reports": [
        {
            "id": 1234,
            "name": "vul_report_1",
            "status": "completed", //running, pending, complete, aborted, failed
            "total_artifacts": 1000,
            "num_of_processed_artifacts": 10,
            "progress": 1,
            "number_of_rows": 10,
            "start_time": "1970-01-01T02:00:00+02:00",
            "end_time": "1970-01-01T03:00:00+02:00",
            "error": "error message in case of failure",
            "author": "user who initiated the report",
            "report_type": "license | vulnerability | operational_risk",
            "project_key": "myproj"
        }
    ]
}