Select the Contents of a Portfolio Folder

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 and selecting object contained within the Portfolio and associated subfolders of an account.

Why Select the Contents of a Portfolio Folder 

You can use the Retrieve call to return information about the object contained within the Portfolio or a subfolder and use it as part of other calls, including creating and sending email messages.

How to Select Contents of a Portfolio Folder 

Use the sample code below as a model for your own call. Remember that the Portfolio contains folders; if a folder isn’t specified, all Portfolio items for the account are returned.

Sample .NET Code 

1string requestID;
2// Filter by the Folder/Category
3SimpleFilterPart sfp = new SimpleFilterPart();
4sfp.Property = "CategoryID";
5sfp.SimpleOperator = SimpleOperators.equals;
6sfp.Value = new string[] { "6437" };
7// Create the RetrieveRequest object
8RetrieveRequest request = new RetrieveRequest();
9request.ObjectType = "Portfolio";
10request.Filter = sfp;
11request.Properties = new string[] { "ObjectID", "CustomerKey", "Client.ID", "CategoryID", "FileName", "DisplayName", "Description", "TypeDescription", "IsUploaded", "IsActive", "FileSizeKB", "ThumbSizeKB", "FileWidthPX", "FileHeightPX", "FileURL", "ThumbURL", "CacheClearTime"};
12// Execute the Retrieve
13APIObject[] results;
14string status = integrationFramework.Retrieve(request, out requestID, out results);
15// Output the results
16System.Text.StringBuilder sb = new System.Text.StringBuilder();
17sb.Append("Portfolio Summary");
18sb.AppendFormat("\nOverall result: {0}.  RequestID: {1}", status, requestID);
19// Print out results for each retrieved object
20for (int cntr = 0; cntr < results.Length; cntr++)
21{
22    sb.Append(string.Format("\n ---- Index {0}", cntr));
23    Portfolio id = results[cntr] as Portfolio;
24    sb.Append("\n CategoryID: " + id.CategoryID);
25    sb.Append("\n DisplayName: " + id.DisplayName);
26    sb.Append("\n FileHeightPX: " + id.FileHeightPX);
27    sb.Append("\n FileName: " + id.FileName);
28    sb.Append("\n FileURL: " + id.FileURL);
29    sb.Append("\n FileWidthPX: " + id.FileWidthPX);
30    sb.Append("\n IsUploaded: " + id.IsUploaded);
31    sb.Append("\n IsActive: " + id.IsActive);
32    sb.Append("\n ThumbSizeKB: " + id.ThumbSizeKB);
33    sb.Append("\n ThumbURL: " + id.ThumbURL);
34    sb.Append("\n TypeDescription: " + id.TypeDescription);
35    sb.Append("\n");
36}
37Console.WriteLine(sb.ToString());

Output 

1Porfolio Summary Overall result: OK.
2RequestID: af2ff633-1a4d-4e42-98d4-1f36edcd1851 ---- Index 0
3CategoryID: 6437
4DisplayName: Gravatar_25
5FileHeightPX: 0
6FileName: Gravatar_25.jpg
7FileURL: m/1/Gravatar_25.jpg
8FileWidthPX: 0
9IsUploaded: False
10IsActive: True
11ThumbSizeKB: 0
12ThumbURL: m/1/thumb/jpg/Gravatar_25.jpg
13TypeDescription:   ---- Index 1
14CategoryID: 6437
15DisplayName: software
16FileHeightPX: 0
17FileName: software.gif
18FileURL: m/1/software.gif
19FileWidthPX: 0
20IsUploaded: False
21IsActive: True
22ThumbSizeKB: 0
23ThumbURL: m/1/thumb/gif/software.jpg
24TypeDescription:

Related Items