# Fetch all the available query reports for the user This API lists all query reports along with their metadata such as Report ID, Label, Owner, View name, Description, and Last modified time. ## Endpoint `GET /dcapi/reports/queryReports` ## Request ### Request URL `https://[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/dcapi/reports/queryReports` ### Scope `DesktopCentralCloud.QueryReport.READ` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers - **Accept** `string` — Mandatory - `application/allQueryReports.v1+json` ### Sample Request ```bash curl --request GET \ --url https://appdomains/dcapi/reports/queryReports \ --header 'Accept: application/allQueryReports.v1+json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' ``` ## Response Parameters ### HTTP Code 200 #### Response Body — `application/json` `JSON Object` - **parent** `string` - Parent node identifier. Always null for the root node. - **children** `JSON Array` - Array of child query-report nodes. Each element represents one saved query report. Null when no reports exist. - **root** `boolean` - Whether this node is the root of the tree. Always true for the top-level response node. - **id** `string` - Unique identifier for this node. Always `queryReports` for the root node. - **label** `string` - Localised display name for this node. Example: Query Reports. - **leaf** `boolean` - Whether this node is a leaf (has no children). False when children exist, true when children is null. - **properties** `JSON Object` - Additional metadata for the root node including report type and expandable/selectable flags. ### HTTP Code 417 #### Response Body — `application/json` `JSON Object` - **errorCode** `string` - Error code for unauthorized MSP access. `REPORT_UNAUTHORIZED` = MSP non-admin user attempting to list query reports. - **errorMessage** `string` - Human-readable message indicating the user is not authorized as an MSP admin to access query reports. ### HTTP Code 500 #### Response Body — `application/json` `JSON Object` - **errorCode** `string` - Error code for server-side failure. `INTERNAL_ERROR` = an unexpected error occurred while fetching the list of query reports (e.g., database exception). - **errorMessage** `string` - Human-readable message describing the internal server error encountered while retrieving available query reports. ### Possible Response Codes - `200` — HTTP code - `417` — HTTP code - `500` — HTTP code ### Sample Response: HTTP 200 Root node with one saved query report as a child: ```json { "parent": null, "children": [ { "parent": "queryReports", "children": null, "root": false, "id": "1", "label": "sample", "leaf": true, "properties": { "owner": "user", "viewName": "SAMPLE", "expandable": false, "selectable": true, "description": "Test Description", "lastModified": "Sep 3, 2024 01:05 PM" } } ], "root": true, "id": "queryReports", "label": "Query Reports", "leaf": false, "properties": { "reportType": "3", "expandable": true, "selectable": true } } ``` Root node with no saved query reports — children is null and expandable/selectable are false: ```json { "parent": null, "children": null, "root": true, "id": "queryReports", "label": "Query Reports", "leaf": true, "properties": { "reportType": "3", "expandable": false, "selectable": false } } ``` ### Sample Response: HTTP 417 MSP non-admin user attempting to list query reports: ```json { "errorMessage": "You are not authorized to access this resource", "errorCode": "REPORT_UNAUTHORIZED" } ``` ### Sample Response: HTTP 500 Unexpected error while fetching available query reports from the database: ```json { "errorMessage": "An internal server error occurred while retrieving query reports", "errorCode": "INTERNAL_ERROR" } ``` ## Rate Limit **Duration:** 1 minute | **Threshold:** 30 | **Lock period:** 5 minutes Duration - Time window for the threshold. Threshold - Number of API calls allowed within the specified duration. Lock Period - Wait time before consecutive API requests.