---
title: <GET> Retrieve Artifacts
slug: lessgetgreater-retrieve-artifacts
docTags: 
createdAt: 2023-05-11T14:07:36.000Z
---

&#x20;\<Get> Retrieve the report and assets as part of the assessment `/api/ais/v1.5/get_report`

Report generation API helps generate defense ,vulnerability reports and attack samples. (vulnerability report, defense artifacts,attack\_samples). For generating reports, there are three parameters:

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.aws.boschaishield.com/prod/api/ais/v1.5/get_report",
  "name": "Retrieve reports",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "children": [],
        "description": "Enter your API key"
      },
      {
        "kind": "required",
        "name": "Org-id",
        "type": "string",
        "children": [],
        "description": "Enter your organization id"
      }
    ],
    "bodyDataParameters": [
      {
        "name": "job_id",
        "kind": "required",
        "type": "string",
        "description": "Enter uniquely created job_id received during model analysis.",
        "children": []
      },
      {
        "name": "report_type",
        "kind": "required",
        "type": "string",
        "description": "You can generate different reports (vulnerability, defense and attack_samples)",
        "children": []
      },
      {
        "name": "file_format",
        "kind": "required",
        "type": "Number",
        "description": "0 - 4 values can be used to generate the report. 0 = all,  2 = pdf, 3 = json",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "TzI4VA5g2T21Ms5IVnv4i",
        "code": "// Returns a JSON object containing the job details for every stage of vulnerability analysis & defense generation",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "kBovGngwgeZFTQzu6B3A-",
        "code": "// Returns an error message if the application cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, etc.)",
        "language": "400",
        "customLabel": ""
      },
      {
        "id": "vgao3JWyZIdVj8T0h3pJq",
        "code": "// Returns an error message if access to the target resource has been denied.(For example- if x-api-key value is incorrect or not given)",
        "language": "403",
        "customLabel": ""
      },
      {
        "id": "_TopuJFmieGM14B7qesQY",
        "code": "// Returns an error message if access to the target resource has been denied. (For example- if any of the parameter value is incorrect or license has expired)",
        "language": "412",
        "customLabel": ""
      },
      {
        "id": "PHZjxhqTuAOMecvlfiiFI",
        "code": "// Returns an error message if the user has sent too many requests(example 15-20 requests in 1 seconds) in a given amount of time.",
        "language": "429",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "kBovGngwgeZFTQzu6B3A-"
  },
  "examples": {
    "languages": [
      {
        "id": "lPX5Xcm0T-jBs1f5Ym11S",
        "language": "python",
        "code": "import requests\n\njobID=\"<< Enter Job ID >>\"\nreportType=\"<< Enter Report Type >>\"\nfileFormat=\" << Enter File Format >>\"\n\nurl = \"https://api.aws.boschaishield.com/prod/api/ais/v1.5/get_report?job_id=\"+jobID+\"&report_type=\"+reportType+\"&file_format=\"+fileFormat+\"\"\n\npayload = {}\nheaders = {\n    'Accept': 'application/json',\n    'x-api-key': '########################################',\n    'Org-Id': '####################################################################################################'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)",
        "customLabel": ""
      },
      {
        "id": "IbCOymI1mJkWYG0jWCGG5",
        "language": "curl",
        "code": "jobID=\"<< Enter Job ID>>\";\nreportType=\"<< Enter Report Type>>\";\ncurl --location 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/get_report?job_id='${jobID}'&report_type='${reportType}'&file_format=2' \\\n--header 'Accept: application/json' \\\n--header 'x-api-key: ########################################' \\\n--header 'Org-Id: ####################################################################################################'",
        "customLabel": ""
      },
      {
        "id": "yRviph54DLvhhf6vg2zuO",
        "language": "nodejs",
        "code": "var request = require('request');\n\njobID = '<< Enter Job ID >>'\nreportType = '<<Enter Report Type >>'\nfileFormat='<< Enter File Format >>'\nvar options = {\n  'method': 'GET',\n  'url': 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/get_report?job_id='+jobID+'&report_type='+reportType+'&file_format='+fileFormat+'',\n  'headers': {\n    'x-api-key': '########################################',\n    'Org-Id': '####################################################################################################'\n  }\n};\nrequest(options, function (error, response) {\n  if (error) throw new Error(error);\n  console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "vRIGveo83V9hRV9k__LDC",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"x-api-key\", \"########################################\");\nmyHeaders.append(\"Org-Id\", \"####################################################################################################\");\n\nvar requestOptions = {\n  method: 'GET',\n  headers: myHeaders,\n  redirect: 'follow'\n};\n\njobID=\"<<Enter JOB ID >>\"\nreportType=\"<< Enter Report Type >>\"\nfileFormat=\"<< Enter File Format >>\"\n\nfetch(\"https://api.aws.boschaishield.com/prod/api/ais/v1.5/get_report?job_id=\"+jobID+\"&report_type=\"+reportType+\"&file_format=\"+fileFormat+\"\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "lPX5Xcm0T-jBs1f5Ym11S"
  },
  "description": "",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  }
}
```
:::

:::hint{type="info"}
- job\_id: Uniquely created `job_id `received during model analysis
- report\_type: parameter to define type of report to download. e.g vulnerability, defense and attack\_samples)
- file\_format: value between 0-4, 0 = all,2 = pdf, 3 = json
:::

:::hint{type="info"}
For using Nodejs sample code, install npm package request

Given ample code for python is tested for Python version 3.7

Given Sample code for nodejs and javascript is tested for Node V20LTS 
:::

