4 Replies Latest reply on Dec 13, 2017 9:46 PM by Lou Patrick

    Eloqua API For CDOs Filter CDO Records Returned

    Ron Kahr

      Is there a way, for a specific CDO, to get all CDO records that have changed since a certain time?

       

      For example, suppose i have a CDO with an id of 108.

       

      I can get a list of all CDO records by making the api call https://secure.p04.eloqua.com/api/REST/2.0/data/customObject/108/instances.

       

      Is there a way of adding a search criteria to get all CDO records that have changed since a certain time.  I tried the following:
      https://secure.p04.eloqua.com/api/REST/2.0/data/customObject/108/instances?search='updatedAt>1497031558'

      but i get the following error in response
      [{"type":"EndpointParameterError","parameter":"search","requirement":{"type":"ReferenceExistsRequirement"},"value":"updatedAt"}]

        • 1. Re: Eloqua API For CDOs Filter CDO Records Returned
          Tom Schreurs

          I'm afraid this is still not working accordingly, there are several reports about this behavior:

          lastUpdateAt field is not working in Rest Client

          Eloqua REST API - Retrieving Visitor Profiles - Filter on lastUpdatedAt Date not working

           

          Tried to use the Rest API with Jan-Pieter Feikens but we are also getting all results back, just like you.

           

          edit: after trying a couple of things, it did work. See reply below.

          • 2. Re: Eloqua API For CDOs Filter CDO Records Returned
            Jan-Pieter Feikens

            Hi,

             

            This is possible, however you are using the Lastupdatedby wrong. The = parameter is applied as a "greater than or equal to" filter, and is in seconds since epoch (Jan 1, 1970). And you don't need to use the search.

             

            See also this topic: Rest API search by updatedAt?

             

            See also my screenshots below, I get 1 result when using 1502976549 and I get 3 results when I go a little bit back in time (1502876549). I am doing a GET on https://secure.p01.eloqua.com/API/REST/1.0/assets/campaigns?lastUpdatedAt=1502976549

            &

             

            You should also keep in mind that the UNIX date you are using is based on the location of the servers (I believe it is the West coast of the US, but check Time Zones Across Eloqua ).

             

            Ron Kahr, can you also please change your username from a random generated code to a normal username, it makes it a bit more personal on Topliners, it should be explained overhere: How to change a Display Name

            • 3. Re: Eloqua API For CDOs Filter CDO Records Returned
              Sanyog Ajnavi

              Hi,

              What about the Original CDO API:

              https://secure.p04.eloqua.com/api/REST/2.0/data/customObject/108/instances

               

              As per the Standard documentation, Search field can be used as below: REST API for Oracle Eloqua Marketing Cloud Service - Retrieve a list of custom object data

              Parameters can be used as below: REST API for Oracle Eloqua Marketing Cloud Service

               

              But I am still not able to figure out how to use any of the fieldsvalue of CDO to query the result set. For search parameter [search='{field}{operator}{value}'] how the value {field} should be queried for any of the CDO fieldvalue?

               

              For Example: My CDO definition is -

              {

                 "type": "CustomObject",

                 "id": "49",

                 "createdAt": "1505824241",

                 "createdBy": "28",

                 "depth": "complete",

                 "description": "CDO for Export",

                 "name": "CDO_Test_01",

                 "updatedAt": "1505824830",

                 "updatedBy": "28",

                 "displayNameFieldId": "245",

                 "fields":    [

                          {

                       "type": "CustomObjectField",

                       "id": "245",

                       "depth": "complete",

                       "name": "Email Address",

                       "dataType": "text",

                       "displayType": "text"

                    },

                   {

                       "type": "CustomObjectField",

                       "id": "246",

                       "depth": "complete",

                       "name": "First Name",

                       "dataType": "text",

                       "displayType": "text"

                    }

              ...

              ...

              }

              based on that, how do we query the CDO field "Email Address" or "First Name" ? Please help.

              • 4. Re: Eloqua API For CDOs Filter CDO Records Returned
                Lou Patrick

                Custom object fields can be queried using the search URL parameter with the custom object field's internalName. The custom object field's internalName can be retrieved using the custom object Application API 2.0 endpoints, Retrieve a custom object and Retrieve a list of custom objects, with the appropriate depth set.

                 

                Here is an example of querying a list of custom object data using a custom object field:

                 

                1. Retrieve a custom object with id of 9 to obtain internal names:

                GET /api/REST/2.0/assets/customObject/9

                Response:

                {

                    "type": "CustomObject",

                    "id": "9",

                    "createdAt": "1457146116",

                    "createdBy": "11",

                    "depth": "complete",

                    "description": "",

                    "folderId": "273",

                    "name": "Test",

                    "updatedAt": "1487725031",

                    "updatedBy": "11",

                    "displayNameFieldId": "104",

                    "emailAddressFieldId": "103",

                    "fields": [

                        {

                            "type": "CustomObjectField",

                            "id": "103",

                            "depth": "complete",

                            "name": "Email Address",

                            "dataType": "text",

                            "displayType": "text",

                            "internalName": "Email_Address1"

                        },

                        {

                            "type": "CustomObjectField",

                            "id": "104",

                            "depth": "complete",

                            "name": "First Name",

                            "dataType": "text",

                            "displayType": "text",

                            "internalName": "First_Name1"

                        },

                        {

                            "type": "CustomObjectField",

                            "id": "106",

                            "depth": "complete",

                            "name": "Number",

                            "dataType": "number",

                            "displayType": "text",

                            "internalName": "Number1"

                        },

                        {

                            "type": "CustomObjectField",

                            "id": "105",

                            "depth": "complete",

                            "name": "Numeric",

                            "dataType": "numeric",

                            "displayType": "text",

                            "internalName": "Numeric1"

                        }

                    ],

                    "recordCount": 25

                }

                2. Retrieve a list of custom object data with a custom object id of 9, using the search URL parameter to return records with a First Name, custom field internal name of First_Name1 retrieved in previous call, of "test":

                GET /api/REST/2.0/data/customObject/9/instances?search=First_Name1=test