previewContactImport
The first rows of an import as the contacts they will become, in the app’s own fields.
The first rows of an import as the contacts they will become, in the app’s own fields: name, phones, emails, property addresses, mailing addresses, tags, lists, deals, and custom fields (every custom field of the workspace is listed; the ones with values are the ones this row fills). contactTransformerRowCount is the number of rows the import will read. A row with error set and no contact will be skipped. contactTransformerRowFindings names the rows to tell the person about before they approve the import: a likely repeat of an earlier row (the same name and a shared phone or email, or for a nameless row a shared phone or email; the import usually merges it into that contact, so say it likely will, never that it will) and a row with no name (it lands under its phone or email), with 0-based row indexes, over the file’s first checkedRows rows; null means the check did not run, so never say the file has no repeats. limit is 1 to 10 (default 8). Show these rows to the person as a table, one row per contact, a column per field that any row fills, and say how many rows the file has. Read only; nothing is imported.
curl https://server.goliathdata.com/api/v1/call \
-H "Authorization: Bearer $GOLIATH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operationId": "previewContactImport",
"variables": {
"fileProcessingTaskId": "<fileProcessingTaskId>"
}
}'import { GoliathClient } from '@goliath-data/sdk'
const goliath = new GoliathClient({
apiKey: process.env.GOLIATH_API_KEY!,
baseUrl: 'https://server.goliathdata.com',
})
const result = await goliath.contactImports.previewContactImport({
fileProcessingTaskId: '<fileProcessingTaskId>'
})const res = await fetch('https://server.goliathdata.com/api/v1/call', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
operationId: 'previewContactImport',
variables: {
fileProcessingTaskId: '<fileProcessingTaskId>'
}
}),
})
const { data, errors } = await res.json()limit is clamped to 10.
Variables
The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.
Default 8.
Response
What comes back under data: a list shows as one entry, and a value as its type.
{
"data": {
"fileProcessingTaskQuery": {
"contactTransformerRowCount": 0,
"contactTransformerRowFindings": {
"checkedRows": 0,
"repeats": [
{
"rowIndex": 0,
"sameAsRowIndex": 0,
"name": "…"
}
],
"namelessRowIndexes": [
0
],
"unstorablePhoneRowIndexes": [
0
],
"flaggedRowChannels": [
{
"rowIndex": 0,
"name": "…",
"phone": "…",
"email": "…",
"droppedPhone": "…"
}
]
},
"contactTransformerPreview": [
{
"rowIndex": 0,
"error": "…",
"mappedNoteBody": "…",
"unlandedCells": [
"…"
],
"contact": {
"name": "…",
"subContacts": [
{
"name": "…",
"relation": "…"
}
],
"phoneNumbers": [
{
"phoneNumber": "…",
"phoneType": "MOBILE"
}
],
"emails": [
{
"email": "…"
}
],
"properties": [
{
"propertyString": "…"
}
],
"mailingAddresses": [
{
"rawText": "…",
"address": {
"line1": "…",
"line2": "…",
"city": "…",
"state": "…",
"zip": "…"
}
}
],
"tags": [
{
"name": "…"
}
],
"lists": [
{
"name": "…"
}
],
"deals": [
{
"title": "…",
"stage": {
"name": "…"
},
"pipeline": {
"name": "…"
}
}
],
"customFields": [
{
"name": "…",
"values": {
"textValue": "…",
"numberValue": 0,
"calendarDate": "…",
"dropdownSelectedValues": [
"…"
]
}
}
]
}
}
]
}
}
}Errors
unknown_variableA variable the operation does not declare. A typo is refused rather than silently dropped.
unauthorizedNo bearer header, or the key is invalid or revoked.
insufficient_scopeThe key lacks the scope the operation requires.
forbiddenA referenced record does not exist, was deleted, or is outside your organization. The gateway cannot tell those apart.
Behaviour
A read. It rejects an Idempotency-Key header with 400 bad_request.