Discussions
help to export data with bulk 2.0 exports API

Hi Eloqua experts,
I want to export data from one of my Eloqua object using Bulk 2.0 Exports API. I followed the example from Eloqua doc on Exporting data but the example failed when I tested it.
The API endpoint I use is: /bulk/2.0/activities/exports
the export json data is: {
"name":"Example Activity Export",
"fields":{
"ActivityId":"{{Activity.Id}}",
"AssetName":"{{Activity.Asset.Name}}",
"ActivityType":"{{Activity.Type}}",
"ActivityDate":"{{Activity.CreatedAt}}",
"ContactId":"{{Activity.Contact.Id}}",
"VisitorId":"{{Activity.Visitor.Id}}",
"AssetType":"{{Activity.Asset.Type}}",
"AssetId":"{{Activity.Asset.Id}}",
"RawData":"{{Activity.Field(RawData)}}"
},
"filter":"'{{Activity.Type}}'='FormSubmit'"
}
But POSTMAN came back with 400 error code validation error. The response from Eloqua is:
"failures": [
{
"field": "name",
"constraint": "Must be a string value, at least 1 character and at most 100 characters long."
},
{
"field": "fields",
"constraint": "Is required."
}
]
}
Please advise what I did wrong with this example code set. I plan to follow it to export data for a segment object.
thanks,
Wayne Chan
Answers
-
attached a copy of test from POSTMAN screen shot.
-
I found the problem and it is fixed. I forgot to include http header : content-type: applicaiton/json to POSTMAN when making the API call.
This leads me to the next problem on my exporting exercise. I am exporting data from a segment which is pointing to a contact list when I reviewed the meta of the segment.
the contact list meta details is as follow:
{"type": "ContactList",
"id": "120",
"createdAt": "1585255747",
"createdBy": "9",
"depth": "complete",
"folderId": "48",
"name": "Individual Contacts 1",
"permissions": "fullControl",
"updatedAt": "1585255767",
"updatedBy": "9",
"count": "1",
"dataLookupId": "2afe463c-e6a2-44b3-8f5a-ab2aa4f53e25",
"scope": "local"
}
I am puzzled how do I get the meta fields of this contact list ??
If I use /bulk/2.0/contacts/list/exports to set up the export definition I will need the field name of to be exported (which is EmailAddress in this case).
Also how do I specify the filter value in the export definition? "filter" : "{{'ContactList.Id'='120'"
The export example in Eloqua doc is using activities as an example so I'm not sure how to do the same for segment export
Help and example of segment export appreciated...
thanks,
Wayne Chan
-
Hi Eloqua,
I further search topliners forum and found an article on data exporting from Lou Patrick advising how data export should be done :
The article listed selected Activity Type to export: (as below)
Select Activity Type to Export
Create an Activity Export Definition for the selected Activity Type
- (Tutorial) Exporting Activities - Define the Export
- Example export definition requests for all Activity Types - Activities export definitions
Is the above listed activities are supported for data exports ?? What about other Eloqua objects such as shared lists, contacts and/ segments ??
thanks,
Wayne Chan
-
Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy
That post only covers activity exports, as specified in the title. You cannot export assets using the Bulk API, but you can add filters on Contact exports for Shared Lists and Segments. See Eloqua Expression Language and Filtering for details and examples. Also, here is the general export tutorial that applies to all objects that are available to export: Activities, Accounts, Contacts, Custom objects, Events, and Campaign responses.