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>
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
    Thanks for your comment. The SOAP API above retrieves from the Root Directory. – user5105 Oct 18 '18 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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.