0

The SOAP API call below only displays Folder names. Does anybody know how to retrieve the list of data extension within a folder?

<Body>
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <RetrieveRequest>
             <ObjectType>DataFolder</ObjectType>
            <!--<Properties>ID</Properties> -->
            <Properties>Description</Properties>
            <Properties>ParentFolder.Description</Properties>
            <!--<Properties>Client.ID</Properties> -->
            <Properties>ParentFolder.CustomerKey</Properties>
            <Properties>Name</Properties>
            <Properties>ContentType</Properties>
            <Properties>ParentFolder.Name</Properties>
            <Properties>ParentFolder.ID</Properties>
            <!--<Properties>ObjectID</Properties>
            <Properties>ParentFolder.ObjectID</Properties>-->

            <Filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
           <LeftOperand xsi:type="par:SimpleFilterPart">
              <Property>ParentFolder.Name</Property>
              <SimpleOperator>equals</SimpleOperator>
              <Value>FOLDER NAME</Value>
           </LeftOperand>
           <LogicalOperator>AND</LogicalOperator>
           <RightOperand xsi:type="par:SimpleFilterPart">
              <Property>ContentType</Property>
              <SimpleOperator>equals</SimpleOperator>
              <Value>dataextension</Value>
           </RightOperand>
        </Filter>
            <QueryAllAccounts>false</QueryAllAccounts>
        </RetrieveRequest>
    </RetrieveRequestMsg>
</Body>

3 Answers 3

1

@user5105 try like this

    <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <Header>
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401- 
  wss-wssecurity-secext-1.0.xsd">
   <UsernameToken>
   <Username>******</Username>
    <Password>******</Password> 
   </UsernameToken>
  </Security>
  </Header>
 <Body>
 <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
  <RetrieveRequest>
  <CategoryID>77772(FolderID)</CategoryID>
     <ObjectType>DataExtension</ObjectType>
     <Properties>CustomerKey</Properties>
     <Properties>Name</Properties>
  </RetrieveRequest>
 </RetrieveRequestMsg>
 </Body>
  </Envelope>
1
  • 1
    Thanks for your comment. The SOAP API above retrieves from the Root Directory.
    – user5105
    Oct 18, 2018 at 16:31
0

You can use this request. I've tested. It works for me.

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <UsernameToken>
            <Username>[user name]</Username>
            <Password>[user password]</Password>
        </UsernameToken>
    </Security>
</Header>
<Body>
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <RetrieveRequest>
            <ObjectType>DataExtension</ObjectType>
            <Properties>CustomerKey</Properties>
            <Properties>Name</Properties>
            <Filter xsi:type="SimpleFilterPart">
                <Property>CategoryID</Property>
                <SimpleOperator>equals</SimpleOperator>
                <Value>[category id value]</Value>
            </Filter>
        </RetrieveRequest>
    </RetrieveRequestMsg>
</Body>

0

Marketing Cloud: to retrieve the list of data extension within a folder:

This worked for me, tested via Postman and even with the Python FuelSDK

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
        <a:Action s:mustUnderstand="1">Retrieve</a:Action>
        <a:To s:mustUnderstand="1">https://{{et_subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To>
        <fueloauth xmlns="http://exacttarget.com">{{dne_etAccessToken}}</fueloauth>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <RetrieveRequest>
                <ObjectType>DataExtension</ObjectType>
                <Properties>ObjectID</Properties>
                <Properties>CustomerKey</Properties>
                <Properties>CategoryID</Properties>
                <Properties>Name</Properties>
                <Properties>IsSendable</Properties>
                <Properties>SendableSubscriberField.Name</Properties>
                <Filter xsi:type="SimpleFilterPart">
                    <Property>CategoryID</Property>
                    <SimpleOperator>equals</SimpleOperator>
                    <Value>[CategoryIDvalue]</Value>
                </Filter>
            </RetrieveRequest>
        </RetrieveRequestMsg>
    </s:Body>
</s:Envelope>

You must log in to answer this question.

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