Create an import definition for a custom object
/api/bulk/2.0/customObjects/{parentId}/imports
Request
- application/json
- text/csv
object
CustomObjectImportIndividual
-
autoDeleteDuration(optional):
string
Title:
autoDeleteDuration
-
createdAt(optional):
string(date-time)
Title:
createdAt
-
createdBy(optional):
string
Title:
createdBy
-
dataRetentionDuration(optional):
string
Title:
dataRetentionDuration
-
externalSystemId(optional):
integer
Title:
externalSystemId
-
fields(optional):
array fields
Title:
fields
-
id(optional):
integer
Title:
id
-
identifierFieldName(optional):
string
Title:
identifierFieldName
-
importPriorityUri(optional):
string
Title:
importPriorityUri
-
isSyncTriggeredOnImport(optional):
boolean
Title:
isSyncTriggeredOnImport
-
isUpdatingMultipleMatchedRecords(optional):
boolean
Title:
isUpdatingMultipleMatchedRecords
-
kbUsed(optional):
integer(int64)
Title:
kbUsed
-
mapDataCards(optional):
boolean
Title:
mapDataCards
-
mapDataCardsCaseSensitiveMatch(optional):
boolean
Title:
mapDataCardsCaseSensitiveMatch
-
mapDataCardsEntityField(optional):
string
Title:
mapDataCardsEntityField
-
mapDataCardsEntityType(optional):
string
Title:
mapDataCardsEntityType
-
mapDataCardsSourceField(optional):
string
Title:
mapDataCardsSourceField
-
name(optional):
string
Title:
name
-
nullIdentifierFieldName(optional):
boolean
Title:
nullIdentifierFieldName
-
parentId(optional):
integer
Title:
parentId
-
syncActions(optional):
array syncActions
Title:
syncActions
-
updatedAt(optional):
string(date-time)
Title:
updatedAt
-
updatedBy(optional):
string
Title:
updatedBy
-
updateRule(optional):
string
Title:
RuleType
Default Value:always
Allowed Values:[ "always", "ifNewIsNotNull", "ifExistingIsNull", "useFieldRule" ]
-
updateRuleByField(optional):
array updateRuleByField
Title:
updateRuleByField
-
uri(optional):
string
Title:
uri
Response
- application/json
201 Response
object
CustomObjectImportIndividualResponse
-
autoDeleteDuration(optional):
string
Title:
autoDeleteDuration
-
createdAt(optional):
string(date-time)
Title:
createdAt
-
createdBy(optional):
string
Title:
createdBy
-
dataRetentionDuration(optional):
string
Title:
dataRetentionDuration
-
externalSystemId(optional):
integer
Title:
externalSystemId
-
fields(optional):
array fields
Title:
fields
-
identifierFieldName(optional):
string
Title:
identifierFieldName
-
importPriorityUri(optional):
string
Title:
importPriorityUri
-
isSyncTriggeredOnImport(optional):
boolean
Title:
isSyncTriggeredOnImport
-
isUpdatingMultipleMatchedRecords(optional):
boolean
Title:
isUpdatingMultipleMatchedRecords
-
kbUsed(optional):
integer(int64)
Title:
kbUsed
-
mapDataCards(optional):
boolean
Title:
mapDataCards
-
mapDataCardsCaseSensitiveMatch(optional):
boolean
Title:
mapDataCardsCaseSensitiveMatch
-
mapDataCardsEntityField(optional):
string
Title:
mapDataCardsEntityField
-
mapDataCardsEntityType(optional):
string
Title:
mapDataCardsEntityType
-
mapDataCardsSourceField(optional):
string
Title:
mapDataCardsSourceField
-
name(optional):
string
Title:
name
-
nullIdentifierFieldName(optional):
boolean
Title:
nullIdentifierFieldName
-
syncActions(optional):
array syncActions
Title:
syncActions
-
updatedAt(optional):
string(date-time)
Title:
updatedAt
-
updatedBy(optional):
string
Title:
updatedBy
-
updateRule(optional):
string
Title:
RuleType
Default Value:always
Allowed Values:[ "always", "ifNewIsNotNull", "ifExistingIsNull", "useFieldRule" ]
-
updateRuleByField(optional):
array updateRuleByField
Title:
updateRuleByField
-
uri(optional):
string
Title:
uri
400 Response
401 Response
403 Response
404 Response
409 Response
410 Response
412 Response
413 Response
500 Response
503 Response
Examples
The following examples demonstrate how to create a custom object import definition using an HTTP request and cURL. For more information on requests, see API requests.
HTTP Request Example
Create a new "Hot Air Balloon" custom object (id #9) import:
POST /customObjects/9/imports
Content-Type: application/json
Request body:
{
"name": "Hot Air Balloon Import",
"fields": {
"inflated": "{{CustomObject[9].Field[99]}}",
"ID": "{{CustomObject[9].ExternalId}}"
},
"identifierFieldName": "ID"
}
Note:
Custom objects are unique to each Eloqua installation. Examples here will not map directly to your custom objects and their fields. You can obtain a list of all custom objects using theGET /customObjects
endpoint. Once you have a custom object's id #, you can retrieve its field list by using the
GET /customobjects/{id}/fields
endpoint: this will allow you to create accurate import/export definitions.
Response:
{
"id": 32082,
"parentId": 9,
"mapDataCardsCaseSensitiveMatch": false,
"name": "Hot Air Balloon Import",
"fields": {
"inflated": "{{CustomObject[9].Field[99]}}",
"ID": "{{CustomObject[9].ExternalId}}"
},
"identifierFieldName": "ID",
"isSyncTriggeredOnImport": false,
"dataRetentionDuration": "P7D",
"isUpdatingMultipleMatchedRecords": false,
"uri": "/customObjects/9/imports/32082",
"createdBy": "API.User",
"createdAt": "2015-09-15T19:27:02.3559836Z",
"updatedBy": "API.User",
"updatedAt": "2015-09-15T19:27:02.3559836Z"
}
Create a new custom object import and map records to contacts via contact ID:
POST /customobjects/9/imports
Content-Type: application/json
Request body:
{
"name": "Simple CDO Contact Import 2",
"mapDataCards": "true",
"mapDataCardsEntityField": "{{Contact.Field(ContactIDExt)}}",
"mapDataCardsSourceField": "contactID",
"mapDataCardsEntityType": "Contact",
"mapDataCardsCaseSensitiveMatch": "false",
"updateRule": "always",
"dataRetentionDuration": "P7D",
"fields": {
"email": "{{CustomObject[8].Field[58]}}",
"first": "{{CustomObject[8].Field[405]}}",
"contactID": "{{CustomObject[8].Field[406]}}"
},
"identifierFieldName": "contactID"
}
-
"mapDataCardsEntityField": "{{Contact.Field(ContactIDExt)}}"
This is the internal Eloqua name for the Eloqua Contact ID field.
-
"mapDataCardsSourceField": "contactID"
This is the source field from imported data that will be used for mapping.
-
"contactID": "{{CustomObject[8].Field[406]}}"
Whichever field you are using for mapping has to exist in both entities (in this case on a contact record and CDO record). Meaning you have to create a new custom data object field for the
contactID
value.
Response
{
"id": 836,
"parentId": 8,
"mapDataCards": true,
"mapDataCardsCaseSensitiveMatch": false,
"mapDataCardsEntityField": "{{Contact.Field(ContactIDExt)}}",
"mapDataCardsSourceField": "contactID",
"mapDataCardsEntityType": "Contact",
"name": "Simple CDO Contact Import 2",
"updateRule": "always",
"fields": {
"email": "{{CustomObject[8].Field[58]}}",
"first": "{{CustomObject[8].Field[405]}}",
"contactID": "{{CustomObject[8].Field[406]}}"
},
"identifierFieldName": "contactID",
"isSyncTriggeredOnImport": false,
"dataRetentionDuration": "P7D",
"isUpdatingMultipleMatchedRecords": false,
"uri": "/customObjects/8/imports/836",
"createdBy": "API.User",
"createdAt": "2016-02-01T21:43:03.7931253Z",
"updatedBy": "API.User",
"updatedAt": "2016-02-01T21:43:03.7931253Z"
}
cURL Example
Here is the same example in cURL given an instance with the name APITest
, username API.User
, and POD of 3
.
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"name":"Hot Air Balloon Import","fields":{"inflated":"{{CustomObject[9].Field[99]}}","ID":"{{CustomObject[9].ExternalId}}"},"identifierFieldName":"ID"}' https://secure.p03.eloqua.com/api/bulk/2.0/customObjects/9/imports