---
title: Statement Analysis - Download Report
slug: api-marketplace/statement-analysis-download-report
createdAt: 2024-04-24T11:38:24.960Z
---

## Introduction:

This is the 3rd API in the Statement Analysis Flow. This API is used to download the analysis report of the Bank Statements provided in the Analyze Statement API. This api supports two different formats Excel and JSON. Users can choose either one or both.

## Sample Curl:

:::CodeblockTabs
Preproduction

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/statementanalysis/download-report' \
--header 'Content-Type: application/json' \
--header 'Authorization: <auth-token>' \
--data '{
    "authToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhYmhpc2hlay5taXNocmFAc2lnbnp5LmNvbSIsInJvbGVzIjpbIkFETUlOIl0sImNsaWVudCI6ImNISmxZMmx6WVY5MFpXNWhiblF5TXprMU9BPT0iLCJ0ZW5hbnRJZCI6IjIzOTU4IiwiYWNjZXNzIjoiZmFsc2UiLCJpYXQiOjE3MTc2NTU5MTEsImV4cCI6MTcxNzc0MjMxMX0.GVBZ582JnJNYYucWty5ZFMvsmhacWg1ctx2QjzB99ak",
	"reportId": "PR2253490007730517",
    "fileType": "excel and json",
    "templateId": "template_1",
    "includeAccountLevelReports":true,
    "borrowerReferenceId": "JOURNEY_08"
    "getTransactions": true
}'
```

Production

```curl
curl --location 'https://api.signzy.app/api/v3/statementanalysis/download-report' \
--header 'Content-Type: application/json' \
--header 'Authorization: <auth-token>' \
--data '{
    "authToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhYmhpc2hlay5taXNocmFAc2lnbnp5LmNvbSIsInJvbGVzIjpbIkFETUlOIl0sImNsaWVudCI6ImNISmxZMmx6WVY5MFpXNWhiblF5TXprMU9BPT0iLCJ0ZW5hbnRJZCI6IjIzOTU4IiwiYWNjZXNzIjoiZmFsc2UiLCJpYXQiOjE3MTc2NTU5MTEsImV4cCI6MTcxNzc0MjMxMX0.GVBZ582JnJNYYucWty5ZFMvsmhacWg1ctx2QjzB99ak",
	"reportId": "PR2253490007730517",
    "fileType": "excel and json",
    "templateId": "template_1",
    "includeAccountLevelReports":true
    "borrowerReferenceId": "JOURNEY_08"
    "getTransactions": true
}'
```
:::

## Input Parameters:

| Parameter                  | Type    | Description                                         | Mandatory/Optional |
| -------------------------- | ------- | --------------------------------------------------- | ------------------ |
| authToken                  | String  | Authentication Token Generated in Authenticate API  | Mandator           |
| reportId                   | String  | reportId to download your report                    | Mandatory          |
| fileType                   | String  | Report Type (Ex:  JSON, Excel, Excel and JSON)      | Mandatory          |
| templateId                 | String  | Custom Template for Report                          | Optional           |
| includeAccountLevelReports | Boolean | Account level analysis report                       | Optional           |
| borrowerReferenceId<br />  | String  | Id which was passed during create web journey link. | Optional           |
| getTransactions            | Boolean | All transaction json link                           | Optional           |

reportId/borrowerReferenceId one of them is mandatory to be passed in req body of download report api.

## Sample Output:

:::CodeblockTabs
sample output

```json
{
    "result": {
        "json": "https://files-preproduction.signzy.tech/api/files/47430328/download/9dbe1c7ad8e541018d5647bff672fd1246fbbb306efc40adb51378df4a5f5cbf.json",
        "excel": "https://files-preproduction.signzy.tech/api/files/47430326/download/edf2054cff404ac188afc3d5a48ab83a3dc3a691d0d2459cb33b5fc2ffac844b.xlsx",
        "base64Excel": "https://files-preproduction.signzy.tech/api/files/47430327/download/b0e0334155964565beb8c47b0303a6b5e68ff8dd122e42c2ae0b5c3a9f2545d9.txt",
        "accountLevelAnalysis": [
            {
                "accountId": "5946",
                "bankName": "RAK Bank",
                "excel": "https://files-preproduction.signzy.tech/api/files/47430321/download/7792ff13e08e448599bf2ecf500a9ad2a2af1e6f6ae144afbb22d97465fabe77.xlsx"
            }
        ],
        "fileUrls": [
            {
                "originalFileUrl": "https://files-preproduction.signzy.tech/api/files/47430254/download/acc9d8b55a524795aa805d3afc83dd1991ce3651b47c4a448c0d17bce8b1aa00.pdf",
                "base64FileUrl": "https://files-preproduction.signzy.tech/api/files/47430253/download/e06fdb48dec242eebf86cb8adc87fa6a243d9dd8a7824a01a29ec8620d2bf69c.txt"
            }
        ],
        "transactionsJsonUrl": [
            {
                "accountId": "5946",
                "bankName": "RAK Bank",
                "json": "https://preproduction-persist.signzy.tech/api/files/47430307/download/a9b929fac24c4799b6c7619d2e18efacb11087535c8049abaaaf6f6955638e61.json"
            }
        ]
    }
}
```
:::

## Output Parameters:

| Parameter                  | Type       | Description                             |
| -------------------------- | ---------- | --------------------------------------- |
| result                     | Object     | Contains Excel and JSON file urls       |
| result.json                | String/URL | Public URL of the JSON report           |
| result.excel               | String/URL | Public URL of the Excel report          |
| result.transactionsJsonUrl | Array      | URLs of the bank statement transactions |



## Status Codes:

:::CodeblockTabs
200 OK

```json
{
	"result": {
		"json": "https://files-preproduction.signzy.tech/api/files/41390259/download/6424cdbbe77a4edd8767a20013c6fae2be428478b7804acb865a99dda76a7e3a.json",
		"excel": "https://files-preproduction.signzy.tech/api/files/41390258/download/4c0f29ac15b64835bada632545a1e82c087e8fd80e204fa2b46d77bbe9a6e526.xlsx"
	}
}
```

404

```json
{
    "error": {
        "reason": "NOT_FOUND",
        "status": 200,
        "message": "reportId not found",
        "type": "Not Found",
        "statusCode": 404,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "\"reportId\" is required",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
1. "\"reportId\" is not allowed to be empty"
2. "\"reoprtId\" is required"
3. "\"fileType\" must be one of [excel, json, excel and json, json and excel]"
4. "\"fileType\" is required"
4. "\"authToken\" is required"
4. "\"authToken\" is not allowed to be empty"
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "status": 500,
        "reason": "ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```
:::

