1

This is a continuation of this question: Retrieve multiple tasks in an Automation via API

Now that we have been able to retrieve the Activities within an Automation, we would like to take it one step further to see if we can get the email details from within that Activity.

The assumption we are using is that we can use the Activity.ObjectID as the filter to associate it with the email. However, there are a lot of email-related objects in the API are we aren't sure which one would be associated with the Activity.

Does anyone know which Email/Send object we should be trying to get and if our Activity.ObjectID assumption is correct for the filter?

Thanks!

1 Answer 1

3

There is no way to really be able to tell if something is an email or any other interaction type from the return in Activity/Tasks which makes this more difficult.

Your best bet to finding the Emails inside the automation is to take the Deinition.ObjectID of the Activity and use that in another API call to the object EmailSendDefinition. This will return the information relating to the email that is used in that activity - if it exists.

Call to Activity Object:

  <RetrieveRequest>
        <ObjectType>Activity</ObjectType>
        <Properties>Definition.ObjectID</Properties>
        <Properties>Name</Properties>
        <Properties>CustomerKey</Properties>
        <Filter xsi:type="SimpleFilterPart">
            <Property>Program.ObjectID</Property>
            <SimpleOperator>equals</SimpleOperator>
            <Value>{{yourProgramID}}</Value>
        </Filter>
     </RetrieveRequest>

You then that the Definition.ObjectID and do the following call:

     <RetrieveRequest>
        <ObjectType>EmailSendDefinition</ObjectType>
        <Properties>ObjectID</Properties>
        <Properties>Name</Properties>
        <Properties>CustomerKey</Properties>
        <Properties>DynamicEmailSubject</Properties>
        <Properties>EmailSubject</Properties>
        <Properties>SendDefinitionList</Properties>
        <Properties>CategoryID</Properties>
        ....
        <Filter xsi:type="SimpleFilterPart">
           <Property>ObjectID</Property>
           <SimpleOperator>equals</SimpleOperator>
           <Value>{{yourDefinition.ObjectID}}</Value>
        </Filter>
     </RetrieveRequest>

On those that are not Email Interactions that you push there should return empty results, which you can then use to filter out only the Email interactions.

Same theory can be used on other interaction definition objects, e.g. QueryDefinition, FilterDefinition, etc.

You must log in to answer this question.

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