TransWikia.com

How to Retrieve all email send definitions by folder (category) ID through the Marketing Cloud API

Salesforce Asked on December 4, 2021

I’m using the SalesForce Marketing Cloud (Exact Target).

I have a folder ID (category ID) and I want to get all the send definitions (user-initiated sends) in that folder via the SOAP API in C#. I know when retrieving lists, I can create a filter that matches on Category (folder ID).

When I attempt to do the same for email send definitions, I receive the status :

Error: The Filter Property ‘CategoryID’ is not a retrievable property.

I tried both Category and CategoryID, and no luck. Anyone have success trying to do this?

Here is my code to set up the filter:

        RetrieveRequest rr = new RetrieveRequest();
        rr.ObjectType = "EmailSendDefinition";
        rr.Properties = new string[] { "ObjectID", "Name", "CategoryID", "SenderProfile.FromName", "SenderProfile.CustomerKey" };

        SimpleFilterPart sfp = new SimpleFilterPart();
        sfp.Property = "CategoryID";
        sfp.SimpleOperator = SimpleOperators.equals;
        sfp.Value = new string[] { categoryId };
        rr.Filter = sfp;

One Answer

I tried with CategoryID in SimpleFilter it works, do you have EmailSendDefinition as ObjectTye in your request? It is not SendDefinition ObjectType

my raw xml looks like below

<ObjectType>EmailSendDefinition</ObjectType><Properties>Name</Properties><Properties>CategoryID</Properties><Filter xsi:type="SimpleFilterPart"><Property>CategoryID</Property><SimpleOperator>equals</SimpleOperator><Value>1234</Value></Filter>

set ClientIDs for RetrieveRequest

        var m_etclient = new etAPI.ClientID();
        m_etclient.ID = 123456;
        m_etclient.IDSpecified = true;
        rr.ClientIDs = new etAPI.ClientID[1];
        rr.ClientIDs[0] = m_etclient;

Answered by Bo Hu on December 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP