# Get or Download TOE PDF Reports
source: https://developer.mastercard.com/riskrecon-api/documentation/testing/toe-pdf-rep-samples/dwnl-toe-rep-smpl/index.md

Allows you to download a TOE Report as a base64-encoded string that represents a PDF file.

## Pre-requisites {#pre-requisites}

Refer to the [Download TOE PDF Reports](https://developer.mastercard.com/riskrecon-api/documentation/use-cases/risk-mgmt-issue-rmdfn/toe-pdf-reports/dwn-toe-rep/index.md) use case.

## Request URL for Sandbox environment {#request-url-for-sandbox-environment}

    GET https://api.sandbox.riskrecon.com/v1/toe_reports/{request_id}

## Request URL for Production environment {#request-url-for-production-environment}

    GET https://api.riskrecon.com/v1/toe_reports/{request_id}

## Test Cases {#test-cases}

### Test Case: Success - Download a TOE PDF Report {#test-case-success---download-a-toe-pdf-report}

**Request**

Here is an example of a request made to download a TOE PDF Report.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/toe_reports/1' \
  -H 'accept: application/json' \
  -H 'Authorization: valid_JWT_token'
```

**Response**

get:

HTTP response 200

```http
< HTTP/1.1 200 OK
< cache-control: max-age=0, private, must-revalidate
< content-disposition: attachment; filename="summary-report-Some Company-Inc.-407631574-2024-2-21%3A17-39-1.pdf"
< content-type: application/pdf; charset=utf-8
< date: Wed, 21 Feb 2024 17:45:40 GMT
< server: Cowboy
< transfer-encoding: chunked
< x-request-id: F7Xx13Va8wmYNakAAUAC
```

### Test Case: Fail - Incorrect Request ID {#test-case-fail---incorrect-request-id}

**Request**

Here is an example of a request made erroneously, using a `curl` command, with a request ID that does not belong to the user's organization. In this case, although the request is syntactically correct, it will still return an error as the user does not have rights to view reports of another organization.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/toe_reports/55' \
  -H 'accept: application/json' \
  -H 'Authorization: valid_JWT_token'
```

**Response**

HTTP Error response 404

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "RISKRECON_API",
        "ReasonCode": "BAD_REQUEST",
        "Description": "We couldn't handle your request.",
        "Recoverable": false,
        "Details": "Invalid JSON payload"
      }
    ]
  }
}
```

### Test Case: Fail - Trying to download report in process {#test-case-fail---trying-to-download-report-in-process}

**Request**

Here is an example of a request made by a user trying to download a report that is still under process.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/toe_reports/1' \
  -H 'accept: application/json' \
  -H 'Authorization: valid_JWT_token'
```

**Response**

HTTP Error response 404

```json
{
    "Errors": {
        "Error": [
            {
                "Description": "Resource Not found.",
                "Details": "File not currently found on S3.",
                "ReasonCode": "NOT_FOUND",
                "Recoverable": false,
                "Source": "RISKRECON_API"
            }
        ]
    }
}
```

### Test Case: Fail - When a report is not found {#test-case-fail---when-a-report-is-not-found}

**Request**

Here is an example of a request made by a user trying to download a report that does not exist.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/toe_reports/1' \
  -H 'accept: application/json' \
  -H 'Authorization: valid_JWT_token'
```

**Response**

HTTP Error response 404

```json
{
    "Errors": {
        "Error": [
            {
                "Description": "Resource Not found.",
                "Details": "Report not found",
                "ReasonCode": "NOT_FOUND",
                "Recoverable": false,
                "Source": "RISKRECON_API"
            }
        ]
    }
}
```

