Retrieve()

Retrieve an array of folders that meet the criteria that you specify.

OrdinalTypeDescription
1JSON objectRequired. A JSON object that contains search criteria.

A simple search contains a single criterion. To perform a simple search, pass a JSON object that contains a Property, a SimpleOperator, and a Value. In some cases, such as when you search for a null value, you can omit the Value.

For example, a simple search can return all folders with an ID between 123456 and 234567, as shown in this code sample.

A complex search contains two criteria that are connected with AND or OR logic. To perform a complex search, pass a JSON object that contains a LeftOperand object, a LogicalOperator, and a RightOperand object.

Both the LeftOperand and RightOperand objects contain the same content as a simple query. That is, they both contain a Property, a SimpleOperator, and a Value.

The value of LogicalOperator is either AND or OR, depending on the type of logic that you want to use to connect the two operands.

This sample shows a complex search that returns image folders where the name of the folder contains the phrase "LoyaltyRewards."

The Property contains the name of the field to perform the search in. For example, to search for folders based on their name, specify Name. This table lists several common properties.

PropertyTypeDescription
NameStringThe name of the folder.
IDNumberThe unique ID of the folder.
DescriptionStringThe optional description of the folder.
ContentTypeStringThe type of content that the folder contains. For a list of possible values, see Value.
IsEditableBooleanIndicates whether the folder can be edited.
PartnerKeyStringAn identifier for the folder that can be used by external partners.
ObjectIDStringA unique ID for the folder.
CustomerKeyStringAn external identifier for the folder.

You can also use dot notation to specify fields in child objects. For example, to search based on the name of the parent folder, specify ParentFolder.Name.

For the SimpleOperator property, specify the comparison that you want to perform between the Property and the Value. This table lists the comparisons that you can perform.

OperatorDescription
betweenSearch for a value that’s between two specified values. For example, ID BETWEEN ["123456","987654"] searches for all ID values greater than or equal to 123456 and less than or equal to 987654.
equalsSearch for an exact match.
greaterThanSearch for a numeric value that’s greater than the specified value.
greaterThanOrEqualSearch for a numeric value that’s greater than or equal to the specified value.
inSearch for any of the values in a list that contains multiple values. For example ID IN {"123456","234567","345678"} searches for any ID values that are exactly 123456, 234567, or 345678.
isNotNullSearch for any non-null value.
isNullSearch for null values.
lessThanSearch for a numeric value that’s less than the specified value.
lessThanOrEqualSearch for a numeric value that’s less than or equal to the specified value.
likeSearch for a string that matches a specified pattern. This operator supports all Transact-SQL wildcard operators.
notEqualsSearch for any value that doesn’t exactly match the specified value.

For the Value property, specify the value that you want to search for.

If you specify contentType for the Property value, specify the type of folder you want to return. This table lists the possible values for this property.

ContentTypeDescription
abtestA/B Test folder
assetContent asset folder
automated_emailAutomated email folder
automationsAutomation Studio folder
buildaudienceactivityBuild audience activity folder
campaignCampaign folder
contentMy contents folder
dataextensionData extensions folder
documentMy documents folder
emailMy emails folder
groupMy groups folder
hiddenHidden items folder
imageMy images folder
jobMy tracking folder
listMy lists folder
livecontentLive content folder
mediaPortfolio folder
micrositeMicrosites folder
micrositelayoutMicrosite layouts folder
filteractivityFilter activity folder
filterdefinitionData filters definition folder
measureMeasures folder
surveyMy surveys folder
messageMessage folder
mysubsMy subscribers folder
organizationOrganizations folder
playbooksPlaybooks folder
programs2My programs folder
publicationMy publication lists folder
queryactivityQuery activity folder
templateMy templates folder
ssjsactivitySSJS Activity folder
suppression_listSuppression Lists folder
triggered_sendTriggered sends folder
triggered_send_journeybuilderJourney Builder triggered sends folder
userinitiatedsendsUser-initiated sends folder

To use this function, pass a JSON object that defines your search criteria. The structure of the JSON object differs based on whether you want to perform a simple search or a complex one.

In a simple search, the JSON object contains the Property, SimpleOperator, and Value properties. This example returns a list of folders that belong to a parent folder named RewardsProgram.

In a complex search, the JSON object contains LeftOperand and RightOperand objects and a LogicalOperator property. The LeftOperand and RightOperand objects each contain a set of Property, SimpleOperator, and Value properties.

This example returns a list of folders in the My Images folder with names that begin with the text "LoyaltyRewards" followed by zero or more other characters.

Whether you perform a simple or complex search, the structure of the result is the same. The result is a JSON array that contains folder objects. Each folder object also contains an object that describes the properties of the parent folder.