Create an activity import definition
/api/bulk/2.0/activities/imports
Request
- application/json
- text/csv
objectActivityImportIndividual-
autoDeleteDuration:
string
Title:
autoDeleteDuration -
createdAt:
string(date-time)
Title:
createdAt -
createdBy:
string
Title:
createdBy -
dataRetentionDuration:
string
Title:
dataRetentionDuration -
externalSystemId:
integer
Title:
externalSystemId -
fields:
object fields
Title:
fields -
identifierFieldName:
string
Title:
identifierFieldName -
importPriorityUri:
string
Title:
importPriorityUri -
isSyncTriggeredOnImport:
boolean
Title:
isSyncTriggeredOnImport -
isUpdatingMultipleMatchedRecords:
boolean
Title:
isUpdatingMultipleMatchedRecords -
kbUsed:
integer(int64)
Title:
kbUsed -
name:
string
Title:
name -
nullIdentifierFieldName:
boolean
Title:
nullIdentifierFieldName -
updatedAt:
string(date-time)
Title:
updatedAt -
updatedBy:
string
Title:
updatedBy -
updateRule:
string
Title:
RuleTypeDefault Value:alwaysAllowed Values:[ "always", "ifNewIsNotNull", "ifExistingIsNull", "useFieldRule" ] -
updateRuleByField:
object updateRuleByField
Title:
updateRuleByField -
uri:
string
Title:
uri
objectfieldsobjectupdateRuleByFieldResponse
- application/json
201 Response
objectActivityImportIndividualResponse-
autoDeleteDuration:
string
Title:
autoDeleteDuration -
createdAt:
string(date-time)
Title:
createdAt -
createdBy:
string
Title:
createdBy -
dataRetentionDuration:
string
Title:
dataRetentionDuration -
externalSystemId:
integer
Title:
externalSystemId -
fields:
object fields
Title:
fields -
identifierFieldName:
string
Title:
identifierFieldName -
importPriorityUri:
string
Title:
importPriorityUri -
isSyncTriggeredOnImport:
boolean
Title:
isSyncTriggeredOnImport -
isUpdatingMultipleMatchedRecords:
boolean
Title:
isUpdatingMultipleMatchedRecords -
kbUsed:
integer(int64)
Title:
kbUsed -
name:
string
Title:
name -
nullIdentifierFieldName:
boolean
Title:
nullIdentifierFieldName -
updatedAt:
string(date-time)
Title:
updatedAt -
updatedBy:
string
Title:
updatedBy -
updateRule:
string
Title:
RuleTypeDefault Value:alwaysAllowed Values:[ "always", "ifNewIsNotNull", "ifExistingIsNull", "useFieldRule" ] -
updateRuleByField:
object updateRuleByField
Title:
updateRuleByField -
uri:
string
Title:
uri
objectfieldsobjectupdateRuleByField400 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 an activity import definition using an HTTP request and cURL. For more information on requests, see API requests. See the tutorial for details on how to import data.
HTTP Request Example
Activity import steps:
Given Eloqua configuration of external activities:
- External Asset Type: Tradeshow
- External Activity: Viewed a Demo
Create a new activity import definition:
POST /activities/imports
Content-Type: application/json
Request body:
{
"name": "External Activity Import via Bulk API",
"updateRule": "always",
"dataRetentionDuration": "PT1H",
"fields": {
"C_EmailAddress": "{{Activity.Contact.Field(C_EmailAddress)}}",
"CampaignID": "{{Activity.Campaign.Id}}",
"AssetName": "{{Activity.Asset.Name}}",
"AssetType": "{{Activity.Asset.Type}}",
"AssetDate": "{{Activity.CreatedAt}}",
"ActivityType": "{{Activity.Type}}"
}
}
Important: When creating Activity imports the following fields are required:
-
One of these match fields:
"C_EmailAddress": "{{Activity.Contact.Field(C_EmailAddress)}}""ContactId": "{{Activity.Contact.Id}}""ContactIDExt": "{{Activity.Contact.Field(ContactIDExt)}}"
"CampaignID": "{{Activity.Campaign.Id}}""AssetName":"{{Activity.Asset.Name}}""AssetType":"{{Activity.Asset.Type}}""AssetDate": "{{Activity.CreatedAt}}""ActivityType": "{{Activity.Type}}"
Response:
{
"name": "External Activity Import via Bulk API",
"updateRule": "always",
"fields": {
"C_EmailAddress": "{{Activity.Contact.Field(C_EmailAddress)}}",
"CampaignID": "{{Activity.Campaign.Id}}",
"AssetName": "{{Activity.Asset.Name}}",
"AssetType": "{{Activity.Asset.Type}}",
"AssetDate": "{{Activity.CreatedAt}}",
"ActivityType": "{{Activity.Type}}"
},
"isSyncTriggeredOnImport": false,
"dataRetentionDuration": "PT1H",
"isUpdatingMultipleMatchedRecords": false,
"uri": "/activities/imports/4219",
"createdBy": "API.User",
"createdAt": "2015-12-17T17:39:59.3643557Z",
"updatedBy": "API.User",
"updatedAt": "2015-12-17T17:39:59.3643557Z"
}
Post data to import definition:
POST /activities/imports/4219/data (URI returned in import definition POST)
Request body:
[
{
"C_EmailAddress": "contact@oracle.com",
"CampaignID": 505,
"AssetName": "Booth Demo",
"AssetType": "Tradeshow",
"AssetDate": "2015-12-12T14:45:00Z",
"ActivityType": "Viewed a Demo"
}
]
Response:
204 No Content
The response, if successful is an HTTP 204 No Content message. The data is now in the staging area, ready to be synced into Eloqua. For more information on importing data into Eloqua, see the tutorial.
C_EmailAddressis the email address of the contact who performed the activity.ContactIdis the id of the contact who performed the activity.ContactIDExtis the string id of the contact who performed the activity.CampaignIDis the ID of the campaign that the activity is to be associated to.AssetNameis the descriptive name to add to the activity record.AssetTypeis the configured External Activity Type to be used for the activity record.AssetDateis the date and time the activity happened.ActivityTypeis the External Activity related to the External Activity Type to be used for the activity record.
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":"External Activity Import via Bulk API","updateRule":"always","dataRetentionDuration":"PT1H","fields":{"C_EmailAddress":"{{Activity.Contact.Field(C_EmailAddress)}}","CampaignID":"{{Activity.Campaign.Id}}","AssetName":"{{Activity.Asset.Name}}","AssetType":"{{Activity.Asset.Type}}","AssetDate":"{{Activity.CreatedAt}}","ActivityType":"{{Activity.Type}}"}}' https://secure.p03.eloqua.com/api/bulk/2.0/activities/imports