Skip to main content
POST
/
api
/
assets
/
download_report
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "your token");

const raw = JSON.stringify({
  "report_id": 84102,
  "file_type": "json"
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("{{path}}/api/assets/download_report/", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
{
    "Executive Summary": {
        "Executive Summary": {
            "summary": {
                "source": [
                    {
                        "id": 1,
                        "title": "openPR.com L4 Self-driving Vehicle Market Current Status and Future Prospects till 2033",
                        "url": "https://www.openpr.com/news/4132700/l4-self-driving-vehicle-market-current-status-and-future",
                        "publisher": "",
                        "date": ""
                    }
                ]
            }
        }
    }
}

Overview

Downloads the generated report in the required format such as docx, pdf, and json. The format is passed in the request body.

Endpoint Details

  • Method: POST
  • Endpoint: /api/assets/download_report/

Authentication requirements

  • Include a valid JWT token in your request header
  • If you don’t have a token yet, you can get one from the /auth/token/ endpoint first.

Request

Request Parameter

Header Parameters

token
string
required
JWT token obtained from the Authentication request

Body Parameters

file_type
string
required
Export format. Permitted values: “pdf”, “docx”, “json”
report_id
integer
required
Id of the report to be exported

Response

Successful response will include download the file in the specified format
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "your token");

const raw = JSON.stringify({
  "report_id": 84102,
  "file_type": "json"
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("{{path}}/api/assets/download_report/", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
{
    "Executive Summary": {
        "Executive Summary": {
            "summary": {
                "source": [
                    {
                        "id": 1,
                        "title": "openPR.com L4 Self-driving Vehicle Market Current Status and Future Prospects till 2033",
                        "url": "https://www.openpr.com/news/4132700/l4-self-driving-vehicle-market-current-status-and-future",
                        "publisher": "",
                        "date": ""
                    }
                ]
            }
        }
    }
}