Create an import definition for a custom object

post

/api/bulk/2.0/customObjects/{parentId}/imports

Creates a new import definition for the specified custom object. See the tutorial for details on how to import data.

Request

Supported Media Types
Path Parameters
Body ()
The request body contains details of the custom object import definition.
Root Schema : CustomObjectImportIndividual
Type: object
Title: CustomObjectImportIndividual
The request body defines the details of the custom object import definition.
Show Source
Nested Schema : fields
Type: array
Title: fields
List of fields to be included in the operation.
Show Source
Nested Schema : syncActions
Type: array
Title: syncActions
Specifies operations to perform during the sync with a maximum of 10 actions. See Sync actions parameters for a list of sync actions. For more information about this parameter, see the Oracle Eloqua Developer Help Center. There currently are not any sync actions available for Events.
Show Source
Back to Top

Response

Supported Media Types

201 Response

Success.
Body ()
Root Schema : CustomObjectImportIndividualResponse
Type: object
Title: CustomObjectImportIndividualResponse
The response body includes information about the custom object import definition.
Show Source
Nested Schema : fields
Type: array
Title: fields
List of fields to be included in the operation.
Show Source
Nested Schema : syncActions
Type: array
Title: syncActions
Specifies operations to perform during the sync with a maximum of 10 actions. See Sync actions parameters for a list of sync actions. For more information about this parameter, see the Oracle Eloqua Developer Help Center. There currently are not any sync actions available for Events.
Show Source

400 Response

Bad request. See Status Codes for information about other possible HTTP status codes.

401 Response

Unauthorized. See Status Codes for information about other possible HTTP status codes.

403 Response

Forbidden. See Status Codes for information about other possible HTTP status codes.

404 Response

The requested resource was not found. See Status Codes for information about other possible HTTP status codes.

409 Response

There was a conflict. See Status Codes for information about other possible HTTP status codes.

410 Response

The requested resource is no longer available. See Status Codes for information about other possible HTTP status codes.

412 Response

The resource you are attempting to delete has dependencies, and cannot be deleted. See Status Codes for information about other possible HTTP status codes.

413 Response

Storage space exceeded. See Status Codes for information about other possible HTTP status codes.

500 Response

The service has encountered an internal server error. See Status Codes for information about other possible HTTP status codes.

503 Response

There was a timeout processing the request. See Status Codes for information about other possible HTTP status codes.
Back to Top

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 the GET /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
			
Back to Top