Fields (metadata)

The bulk API provides fields endpoints for account, contact, custom objects, events, campaign responses, and opportunities. Activity elements behave differently from other Eloqua elements. Activity types have their own set of associated fields which are detailed here. In order to create export or import definitions using the bulk API, you need to include the statement definitions for the fields you want to retrieve or submit (respectively).

Example

Let's say we want to export a set of contacts from Eloqua. Before we can do so, we need to know which fields are available, and what their Eloqua markup language statements are.

Retrieve a list of the first 10 contact field parameters:

GET /contacts/fields?limit=10

Note: there are likely to be many more fields than 10, and the exact number differs for every Eloqua instance, but for the purposes of this example we will limit our scope to the first 10 fields.

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
X-Request-Id: dd60555b-2202-48e1-9a53-fc7761494cb8
X-Powered-By: ServiceStack/3.924 Win32NT/.NET
P3P: CP="IDC DSP COR DEVa TAIa OUR BUS PHY ONL UNI COM NAV CNT STA",

Date: Tue,
 22 Sep 2015 18:42:00 GMT
Content-Length: 3575

{
    "items":[
        {
            "name":"Email Address",
            "internalName":"C_EmailAddress",
            "dataType":"emailAddress",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":true,
            "statement":"{{Contact.Field(C_EmailAddress)}}",
            "uri":"/contacts/fields/100001",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedAt":"1900-01-01T05:00:00.0000000Z"
        },
        {
            "name":"First Name",
            "internalName":"C_FirstName",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_FirstName)}}",
            "uri":"/contacts/fields/100002",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatformTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.8100000Z"
        },
        {
            "name":"Last Name",
            "internalName":"C_LastName",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_LastName)}}",
            "uri":"/contacts/fields/100003",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatformTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.8100000Z"
        },
        {
            "name":"Company",
            "internalName":"C_Company",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_Company)}}",
            "uri":"/contacts/fields/100004",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatformTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.8030000Z"
        },
        {
            "name":"Email Display Name",
            "internalName":"C_EmailDisplayName",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_EmailDisplayName)}}",
            "uri":"/contacts/fields/100005",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedAt":"1900-01-01T05:00:00.0000000Z"
        },
        {
            "name":"Address 1",
            "internalName":"C_Address1",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_Address1)}}",
            "uri":"/contacts/fields/100006",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatformTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.7900000Z"
        },
        {
            "name":"Address 2",
            "internalName":"C_Address2",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_Address2)}}",
            "uri":"/contacts/fields/100007",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatformTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.7930000Z"
        },
        {
            "name":"Address 3",
            "internalName":"C_Address3",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_Address3)}}",
            "uri":"/contacts/fields/100008",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedAt":"1900-01-01T05:00:00.0000000Z"
        },
        {
            "name":"City",
            "internalName":"C_City",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_City)}}",
            "uri":"/contacts/fields/100009",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatfoemailrmTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.8000000Z"
        },
        {
            "name":"State or Province",
            "internalName":"C_State_Prov",
            "dataType":"string",
            "hasReadOnlyConstraint":false,
            "hasNotNullConstraint":false,
            "hasUniquenessConstraint":false,
            "statement":"{{Contact.Field(C_State_Prov)}}",
            "uri":"/contacts/fields/100010",
            "createdAt":"1900-01-01T05:00:00.0000000Z",
            "updatedBy":"MgrPlatformTeamPod1",
            "updatedAt":"2014-06-16T14:43:50.8130000Z"
        }
    ],
    "totalResults":62,
    "limit":10,
    "offset":0,
    "count":10,
    "hasMore":true
}

On this list we see Email Address, First Name, Last Name, Company, Email Display Name, Address 1, Address 2, Address 3, City and State or Province.

Let's say now we want to export a set of contact containing email address, last name, and city information. To do so, we would create the following export definition:

POST /contacts/exports

Request body:

{
   "name":"New Contact Export",
   "fields":{
      "email_contact":"{{Contact.Field(C_EmailAddress)}}",
      "family_name":"{{Contact.Field(C_LastName)}}",
      "city_they_live_in":"{{Contact.Field(C_City)}}"
   }
}

Response:

HTTP/1.1 201 Created
Cache-Control: private
Content-Type: application/json; charset=utf-8
X-Request-Id: 1cc83f79-c839-4ddd-b270-1b6b641ff996
X-Powered-By: ServiceStack/3.924 Win32NT/.NET
P3P: CP="IDC DSP COR DEVa TAIa OUR BUS PHY ONL UNI COM NAV CNT STA",

Date: Tue,
 22 Sep 2015 18:57:10 GMT
Content-Length: 392

{
    "name":"New Contact Export",
    "fields":{
        "email_contact":"{{Contact.Field(C_EmailAddress)}}",
        "family_name":"{{Contact.Field(C_LastName)}}",
        "city_they_live_in":"{{Contact.Field(C_City)}}"
    },
    "dataRetentionDuration":"P7D",
    "uri":"/contacts/exports/32855",
    "createdBy":"Philip.Horwitz",
    "createdAt":"2015-09-22T18:57:10.0723218Z",
    "updatedBy":"Philip.Horwitz",
    "updatedAt":"2015-09-22T18:57:10.0723218Z"
}

See Also