# getContactImport

The status of an import: status (CREATED and AUTHORING_TRANSFORMER = not confirmed yet, PENDING_PROCESSING and PROCESSING = importing, COMPLETED, FAILED, NOT_ENOUGH_BALANCE), totalRows, the contacts produced so far (producedRecordsCount), a best-effort estimatedRemainingTimeInSeconds (it runs high early in an import, so never promise a time from it: the chat that started the import is told when it finishes), the upload’s own list (contactTag, named for the file; not the list the person chose), and the results report: created, matched (an existing contact updated, or one an earlier row of this same file made), duplicateRowCount (rows that repeat an earlier row of this file), mergedAfterImportCount (the duplicate rows whose new contact was merged into an earlier row’s after the import; the rest of the duplicates count as matched, so contacts they already had = matched - (duplicateRowCount - mergedAfterImportCount)), restored (an archived match brought back), skipped and failed rows, and processedRowCount. One read answers "how is it going". For an import this chat started, the chat is told when it finishes, so a code task never polls it; for one started elsewhere (Files, another chat), poll every 10 to 30 seconds.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getContactImport", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `fileProcessingTaskId`: `ID!` (required)

## Response (data, an example)

```json
{
  "fileProcessingTaskQuery": {
    "fileProcessingTask": {
      "id": "<ID>",
      "status": "CREATED",
      "totalRows": 0,
      "producedRecordsCount": 0,
      "estimatedRemainingTimeInSeconds": 0,
      "contactTag": {
        "name": "…"
      }
    },
    "uploadReport": {
      "createdCount": 0,
      "matchedCount": 0,
      "restoredCount": 0,
      "skippedCount": 0,
      "failedCount": 0,
      "mergedAfterImportCount": 0,
      "duplicateRowCount": 0,
      "processedRowCount": 0
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getContactImport",
    "variables": {
      "fileProcessingTaskId": "<fileProcessingTaskId>"
    }
  }'
```
