0

Using the Marketing Cloud API I'm trying to programmatically determine the fields in an event definition. So...

  1. I can start with the ID of the journey and get the journey definition with /interaction/v1/interactions/{{JOURNEYID}}
  2. From there I can get the eventDefinitionId and call /interaction/v1/eventDefinitions/{{EVENTDEFINITIONID}}
  3. And now I am stuck! I can't get the External/Customer Key for the data extension that houses the data for the event definition. I can only get the dataExtensionId and dataExtensionName values.

It looks like I need to use the SOAP API to retrieve the list of fields in a Data Extension, but I can't seem to create the simpleFilterPart that uses ObjectID. It only seems to work when using the CustomerKey value! (I've tested on DE's where I just grab the External Key from the UI)

Get Event Definition Response

Here's a snippet of the code I'm playing with. I can't get any other filter "property" to work!

        $getDE = new ET_DataExtension();
        $getDE->authStub = $myclient;
        $getDE->props = array("CustomerKey", "Name", "Status", "CategoryID", "Description", "IsSendable", "IsTestable", "PartnerKey");  
        $getDE->filter = array('Property' => 'CustomerKey','SimpleOperator' => 'equals','Value' => $de_key);
        $getResult = $getDE->get();
        print_r('Get Status: '.($getResult->status ? 'true' : 'false')."\n");
        print 'Code: '.$getResult->code."\n";
        print 'Message: '.$getResult->message."\n";
        print_r('More Results: '.($getResult->moreResults ? 'true' : 'false')."\n");
        print 'Result Count: '.count($getResult->results)."\n";
        print 'Results: '."\n";
        print_r($getResult->results);
        print "\n---------------\n";

1 Answer 1

1

So after doing some research the only field you can use is DataExtension.CustomerKey in your filter, none of the other fields are supported such as id, objectid, or name

So you would first need to do a retrieve on the DataExtension Object

<soapenv:Body>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>DataExtension</ObjectType>
            <Properties>Client.ID</Properties>
            <Properties>DataRetentionPeriod</Properties>
            <Properties>Name</Properties>
            <Properties>DataRetentionPeriodLength</Properties>
            <Properties>DataRetentionPeriodUnitOfMeasure</Properties>
            <Properties>ObjectID</Properties>
            <Properties>CustomerKey</Properties>
            <Filter xsi:type="SimpleFilterPart">
               <Property>ObjectID</Property>
               <SimpleOperator>equals</SimpleOperator>
               <Value>XXXXXXXX</Value>
            </Filter>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .