getCardImportResult

getCardImportResult

Overview

This method downloads a CSV report of the final outcome for every row in an import batch, including rows that were created, updated, skipped or failed.

The result report is only available after the batch has been processed.

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}/result https://api.{{environment}}.catch-e.com/fm/cards/imports/{import_batch_id}/result https://api.test.catch-e.com/fm/cards/imports/{import_batch_id}/result 

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 uploaded row. The Content-Disposition header is set to attachment; filename="card-import-{import_batch_id}-result.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

Action performed: create, update, or blank if not applicable.

status

Final outcome: create, update, invalid, duplicate or unauthorized.

error_message

Why the row failed, or blank for rows processed successfully.

card_id

The card_id of the created or updated card, or blank if the row was not processed.

row_number,card_number,action,status,error_message,card_id 1,[CARD-NUMBER],create,create,,1234 

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

422 - Unprocessable Entity

The batch exists but has not yet been processed. The result CSV is only available after processCardImport has completed.

{ "warning_messages": {}, "validation_messages": { "fieldName": { "validationExceptionCode": "A textual description of the validation exception" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

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" }