getCardImportErrors

getCardImportErrors

Overview

This method downloads a CSV report of every row in an import batch that was classified as invalid, duplicate or unauthorized during validation. Rows classified as create or update are not included.

The error report is available as soon as the upload step is complete.

This API is part of the card import process:

  1. createCardImport – upload and validate the CSV file.

  2. getCardImportErrors – download the rows that failed validation (optional).

  3. processCardImport – create and update the valid cards.

  4. getCardImportResult – download the final outcome for every row.

This method requires the Cards:Get permission to be associated with your role.

Permissions

The permission for this api is stored in [gb_api_permissions]permission as 'Cards:Get'.

Only roles with a stored link to this permission in [gb_role_api_permissions] can run this api.

HTTP Method

Use the HTTP Method 'GET' for consuming this web service.

URL Examples

https://api.demo.catch-e.com/fm/cards/imports/{import_batch_id}/errors https://api.{{environment}}.catch-e.com/fm/cards/imports/{import_batch_id}/errors https://api.test.catch-e.com/fm/cards/imports/{import_batch_id}/errors 

Path Parameters

Key

Format

Notes

Mandatory

import_batch_id

string

The import_batch_id returned by createCardImport. A positive whole number, up to 10 digits.

Yes

Response Details

Success

200 - OK

Returns a CSV file (text/csv) with a header row and one row per failed or skipped row. The Content-Disposition header is set to attachment; filename="card-import-{import_batch_id}-errors.csv".

Column

Notes

row_number

Row number in the uploaded file, starting at 1 and excluding the header row.

card_number

Card number from the uploaded row.

action

Intended action: create, update, or blank if it could not be determined.

status

Row classification: invalid, duplicate or unauthorized.

error_message

Why the row failed validation.

row_number,card_number,action,status,error_message 4,[CARD-NUMBER],create,invalid,[ERROR-MESSAGE] 

204 - No Content

No error rows exist for this batch. All rows passed validation.

Error Response Details

Validation Message

Comments

401 - Unauthorized

1. You have not authenticated before running this API or 2. The token_timeout of the current session has passed. You need to authenticate again.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized" } 

Validation Message

Comments

403 - Forbidden

- You do not have permissions for this request. - Go to System Roles and enter 'web_services' - Navigate to the Roles / APIs tab to make sure the permission you need to run this API is checked.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden" } 

Validation Message

Comments

404 - Not Found

The specified import batch does not exist.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Found", "status": 404, "detail": "Not Found" } 

Validation Message

Comments

406 - Not Acceptable

The Accept header of the request does not match a response format this API supports.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Acceptable", "status": 406, "detail": "Not Acceptable" } 

Validation Message

Comments

500 - Internal Error

An unexpected error occurred on the server.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" } 

Validation Message

Comments

default - Unexpected Error

Any other unexpected error.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" }