Export a specified query report as a PDF or CSV file

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Exports a previously saved query report as a downloadable file in the specified format (PDF or CSV). The report is looked up by its ID, the associated SQL query is executed, and the result is downloaded as a file.

Request URL

https://{serverurl}/dcapi/reports/queryReports/{id}/export

Scope

DesktopCentralCloud.QueryReport.READCopied!

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Request Parameters

- Request Headers

AcceptstringMandatory
application/octet-streamapplication/octet-streamCopied!

- Path Parameters

idstringMandatory

The unique id retrieved for saved query report

- Query Parameters

formatstringOptional

The export file format. Allowed values: pdf, csv. Defaults to pdf if not specified

Sample Request

Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request GET \
  --url https://appdomains/dcapi/reports/queryReports/{id}/export \
  --header 'Accept: application/octet-stream' \
  --header 'Authorization: Zoho-oauthtoken  d92d4xxxxxxxxxxxxx15f52'

Response Parameters

- HTTP code 400

Response Body - application/json
JSON Object
Hide Sub-Attributes
errorCodestring

Error code for invalid export request. INVALID_QUERY = the requested export format is not supported (only pdf and csv are allowed)

errorMessagestring

Human-readable message describing why the export request failed. Example: Un-Supported format

- HTTP code 401

Response Body - application/json
JSON Object
Hide Sub-Attributes
errorCodestring

Error code for unauthorized access. REPORT_UNAUTHORIZED = the specified report ID was not found or the user does not have permission to access it

errorMessagestring

Human-readable message indicating the user is not authorized to access the specified query report

- HTTP code 500

Response Body - application/json
JSON Object
Hide Sub-Attributes
errorCodestring

Error code for server-side failure. INTERNAL_ERROR = an unexpected error occurred during query execution or file generation

errorMessagestring

Human-readable message describing the internal server error encountered during the export process

Possible Response Codes

200HTTP code
400HTTP code
401HTTP code
500HTTP code

Sample Response: HTTP 200

Copied!
200 OK
Show full

Sample Response: HTTP 400

Export format is not pdf or csv

Copied!
  {
    "errorMessage": "Un-Supported format",
    "errorCode": "INVALID_QUERY"
  }
                
Show full

Sample Response: HTTP 401

Report ID does not exist or user does not have permission

Copied!
  {
    "errorMessage": "You are not authorized to access this report",
    "errorCode": "REPORT_UNAUTHORIZED"
  }
                
Show full

Sample Response: HTTP 500

Unexpected error during query execution or file generation

Copied!
  {
    "errorMessage": "An internal server error occurred while exporting the query report",
    "errorCode": "INTERNAL_ERROR"
  }
                
Show full

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.