---
schema_version: "1"
id: 422519d257bc8f8e1175261491875bdb1f5f78d8712f4fc31f2732695603ff2d
title: Retrieve the Email Folder Hierarchy
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-apis/retrieving_the_email_folder_hierarchy.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/retrieving_the_email_folder_hierarchy.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6441eb47fcc869b222610e6684786b7a441e69230c0af85a74d1983bb8375ce4
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Retrieve the Email Folder Hierarchy

Marketing Cloud Engagement has a new model for storing, finding, managing, creating, sharing, and distributing all content-related objects. Access the objects created with the new Content Builder tools using the REST API. Your existing SOAP API integrations only function with the Classic tools.

This page contains information about retrieving the email folder hierarchy.

## Why Retrieve the Email Folder Hierarchy

This API call retrieves a collection of folders. Each folder has the following information:

1.  ID - The ID of the folder
2.  ParentID - The ID of the folder this folder is nested within (0 if this is a parent folder)
3.  Name - The name of the folder

This call retrieves only the email folder hierarchy, not the actual email messages.

Use these code examples as guides to construct your own API calls.

## Sample .NET Code

<!-- Moved Gist inline (mc-doc/c62c5d18c0bac210b6e4186bd5011a6c) -->

```cs
private void RetrieveDataFolder()
{
    SoapClient framework = new SoapClient();
    framework.ClientCredentials.UserName.UserName = "xxx";
    framework.ClientCredentials.UserName.Password = "xxx";
    String requestID;
    String status;
    APIObject[] results;
    SimpleFilterPart sfp = new SimpleFilterPart();
    sfp.Property = "ContentType";
    sfp.SimpleOperator = SimpleOperators.equals;
    sfp.Value = new string[] { "email" };
    RetrieveRequest rr = new RetrieveRequest();
    rr.ObjectType = "DataFolder";
    rr.Properties = new string[] { "ID", "Name", "ParentFolder.ID","ParentFolder.Name" };
    rr.Filter = sfp;
    status = framework.Retrieve(rr, out requestID, out results);
    Console.WriteLine(status);
    foreach (DataFolder df in results)
    {
Console.WriteLine("---------");
Console.WriteLine("Folder Name: " + df.Name);
Console.WriteLine("Folder ID: " + df.ID);
Console.WriteLine("Parent Folder Name: " + df.ParentFolder.Name);
Console.WriteLine("Parent Folder ID: " + df.ParentFolder.ID);
    }
}
```

## SOAP Envelope

<!-- Moved Gist inline (mc-doc/4ff9ac6b800fe155ec5b8b76efa61f6c) -->

```xml
<soap:Body>
  <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <RetrieveRequest>
      <ObjectType>DataFolder</ObjectType>
      <Properties>Client.ID</Properties>
      <Properties>Name</Properties>
      <Properties>ID</Properties>
      <Properties>ObjectID</Properties>
      <Properties>ContentType</Properties>
      <!--Parent Details-->
      <Properties>ParentFolder.ContentType</Properties>
      <Properties>ParentFolder.ID</Properties>
      <Properties>ParentFolder.ObjectID</Properties>
      <Properties>ParentFolder.Name</Properties>
      <Filter xsi:type="SimpleFilterPart">
        <Property>ContentType</Property>
        <SimpleOperator>equals</SimpleOperator>
        <Value>email</Value>
      </Filter>
      <QueryAllAccounts>true</QueryAllAccounts>
    </RetrieveRequest>
  </RetrieveRequestMsg>
</soap:Body>
```

## Related Items

- [REST API](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/content-api.md)
