# Get File Ingestion Status

This API will be used to know the final status of the ingestion.&#x20;

### Request Method

GET

### Request URL

```
{{BASE_URL}}/ingestion/integration/v1/{templateType}/ingest/file/status/{activityId}?tenant={tenant}
```

### Request Headers

| Parameter             | Data Type | Field Validation | Description                               |
| --------------------- | --------- | ---------------- | ----------------------------------------- |
| x-cleartax-auth-token | String    | NA               | <p>Mandatory. </p><p>User auth token.</p> |

### Request Path Params

| Parameter    | Data Type | Field Validation        | Description                                                    |
| ------------ | --------- | ----------------------- | -------------------------------------------------------------- |
| templateType | String    | <p>Enum: tds</p><p></p> | <p>Mandatory. </p><p>This will always be “tds”.</p>            |
| activityId   | String    | NA                      | Mandatory. Activity ID received in Trigger File Ingestion API. |

### Request Query Params

| Parameter | Data Type | Field Validation                                                                                                            | Description |
| --------- | --------- | --------------------------------------------------------------------------------------------------------------------------- | ----------- |
| tenant    | String    | <p></p><p>Enum:</p><p>For 24Q - TDSV224Q<br>For 26Q - TDSV226Q<br>For 27Q - TDSV227Q<br>For 27EQ - TDSV227EQ</p><p><br></p> | Mandatory.  |

### Request Body

There is no request body for this API.

### Response Status Codes

| HTTP Status Code | Description           |
| ---------------- | --------------------- |
| 200              | OK                    |
| 400              | Bad request.          |
| 401              | Unauthorized          |
| 500              | Internal Server Error |

### Response Schema

| Parameter       | Data Type | Field Validations                                                                                                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| activityId      | String    | NA                                                                                                                                                                                   | Activity ID requested in the request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| status          | String    | <p>Enum:<br>ACTIVITY_CREATED, ACTIVITY_QUEUED, ACTIVITY_COMPLETED, ACTIVITY_DISCARDED,</p><p>SYSTEM_FEEDBACK,<br>UNPLANNED_ERROR,</p><p>FILE_VALIDATION,</p><p>ERROR_FILE_UPLOAD</p> | <p>Status of the triggered ingestion activity.<br><br>ACTIVITY_CREATED - Ingestion triggered,</p><p>ACTIVITY_QUEUED - Ingestion in progress,</p><p>ACTIVITY_COMPLETED - Ingestion completed or aborted or error,</p><p>ACTIVITY_DISCARDED - Ingestion deleted from UI.</p><p>SYSTEM_FEEDBACK - Any handled error on the file, eg: file corrupted, mandatory header missing, duplicate header, etc.<br>UNPLANNED_ERROR - Any unhandled error.</p><p>FILE_VALIDATION - Ingestion is in progress, file header validation is done, and yet to be picked by subactivity for row validation.</p><p>ERROR_FILE_UPLOAD - Row Validation is done, file containing validation error records is being uploaded.</p> |
| processingStats | Array     | NA                                                                                                                                                                                   | Array of Processing Stats objects. If the activity is not completed, then this field will be an empty array.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| fileError       | Object    | NA                                                                                                                                                                                   | File Error Object. If there is no file error, then this field will be null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| errors          | Array     | NA                                                                                                                                                                                   | Array of Error Objects. If there are no errors, then this will be an empty array.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

#### Processing Stats Object

| Parameter          | Data Type | Field Validations | Description                                          |
| ------------------ | --------- | ----------------- | ---------------------------------------------------- |
| identifier         | String    | NA                | Identifier.                                          |
| totalDocumentCount | Number    | NA                | Count of total documents parsed from the valid rows. |
| validRows          | Number    | NA                | Count of valid rows.                                 |
| invalidRows        | Number    | NA                | Count of invalid rows.                               |

#### File Error Object

| Parameter     | Data Type | Field Validations                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------- | --------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| inputFileName | String    | NA                                                   | Filename used in Trigger File Ingestion API.                                                                                                                                                                                                                                                                                                                                                               |
| status        | String    | <p>Enum: DATA_VALIDATION_ERROR,</p><p>FILE_ERROR</p> | <p>Status of the error file.</p><p></p><p>DATA_VALIDATION_ERROR - This error occurs when there is a validation error in the data provided in the sheet.</p><p></p><p>FILE_ERROR - This error represents system feedback for all errors that are not data validation errors. For example, if a file is expected to be without a password but is received with a password, it falls under this category.</p> |
| errorFileUrl  | String    | NA                                                   | URL from where the error file can be downloaded. This pre-signed URL is valid for 10 hours. This file will be in CSV format.                                                                                                                                                                                                                                                                               |
| errors        | Array     | NA                                                   | Array of File Error Details Object. If there are no errors, this will be null.                                                                                                                                                                                                                                                                                                                             |

#### Error Object

| Parameter    | Data Type | Field Validations | Descriptions                                                                          |
| ------------ | --------- | ----------------- | ------------------------------------------------------------------------------------- |
| errorCode    | String    | NA                | Error code. If there is no error code, then this will be null.                        |
| errorMessage | String    | NA                | Error message. If there is no error message, then this will be null.                  |
| errorField   | String    | NA                | Error field. If there is no error field, then this will be null.                      |
| errorValues  | Array     | NA                | Array of strings. Error values. If there are no error values, then this will be null. |

### Sample Response (Success)

Success - HTTP Status Code - 200

```json
{
    "activityId": "b460c73d49c7407bb4bb2a93616fc0de",
    "status": "ACTIVITY_COMPLETED",
    "processingStats": [
        {
            "identifier": "",
            "totalDocumentCount": 1,
            "validRows": 0,
            "invalidRows": 1
        }
    ],
    "fileError": {
        "inputFileName": "TDS-TEST.csv",
        "status": "DATA_VALIDATION_ERROR",
        "errorFileUrl": "https://storage.clear.in/v1/ap-south-1/ingestionv2-staging/My%20Organis_TDSV2_b460c73d49c7407bb4bb2a93616fc0de.csv?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEBkaCmFwLXNvdXRoLTEiRzBFAiEAygdXFleTIJmj6qMGwiw8I%2FpMYNPYSIJvW9dLNuJ%2BXngCIDygAe6yPt0vEEnyOdLBcsVPgJ%2F2rAl7BjyW38uAKmJcKoIFCBIQBRoMMjE5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ldWxsvMj39cltXsNboIuDfl4pe9z59tgWPuZFUEcwg17nkBO8Fg%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230922T094716Z&X-Amz-SignedHeaders=host&X-Amz-Expires=35999&X-Amz-Credential=ASIATGEOL5AHVAIH3VM2%2F20230922%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=e77907b37feb121254af1955bfe4efa6a6f9ab84afa04bc17a3f4465ae92568a",
        "error": null
    },
    "errors": []
}
```

### Sample Response (Error)

HTTP Status Code - 401 Unauthorized

```json
{
    "activityId": null,
    "status": null,
    "processingStats": [],
    "fileError": null,
    "errors": [
        {
            "errorMessage": "Invalid Auth Token",
            "errorField": null,
            "errorValues": null,
            "errorCode": "AUTHENTICATION_FAILED"
        }
    ]
}
```

### API Validations

Currently there are no known validations.

### API Constraints

Currently there are no known constraints.&#x20;
