Create an activity import definition

post

/api/bulk/2.0/activities/imports

Creates a new activity import definition to be used to import external activities related to external assets only. See the tutorial for details on how to import data.

Request

Supported Media Types
Body ()
Root Schema : ActivityImportIndividual
Type: object
Title: ActivityImportIndividual
Show Source
Nested Schema : fields
Type: object
Title: fields
Nested Schema : updateRuleByField
Type: object
Title: updateRuleByField
Back to Top

Response

Supported Media Types

201 Response

Success.
Body ()
Root Schema : ActivityImportIndividualResponse
Type: object
Title: ActivityImportIndividualResponse
Show Source
Nested Schema : fields
Type: object
Title: fields
Nested Schema : updateRuleByField
Type: object
Title: updateRuleByField

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 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:

  • "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}}"

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_EmailAddress is the email address of the contact who performed the activity.
  • CampaignID is the ID of the campaign that the activity is to be associated to.
  • AssetName is the descriptive name to add to the activity record.
  • AssetType is the configured External Activity Type to be used for the activity record.
  • AssetDate is the date and time the activity happened.
  • ActivityType is 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
			
Back to Top