Get the Folder Hierarchy

Gets the folder hierarchy for a specified folder.

Note: For more information about this command, including descriptions of any path and request parameters, request body schema, response codes and schemas, and payload examples, refer to the online API reference for this command at the following web page:

Get the folder hierarchy

URI

https://bartendercloud.com/api/librarian/spaces/{spaceId}/folders

Note: The bartendercloud.com domain that is referenced in the URI and in the code example that follows must be replaced with the contents of the DataCenterURI claim that is extracted from your access token. For more information, refer to Extracting the DataCenterURI Claim.

Path Parameters

spaceId

Type: Integer <int32>

Specifies the ID of the requested space. Use the number 1 to target the Main space or the number 2 to target the $temp space. Required.

Query Parameters

includeHidden

Type: Boolean

When true, specifies that the response includes hidden subfolders. The default value is false. Optional.

includeDeleted

Type: Boolean

When true, specifies that the response includes deleted subfolders. The default value is false. Optional.

Example

Request body: None.

Response: See FolderHierarchy.

Copy
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");

// Get folders, including those that are marked as hidden.
int spaceId = 1; // Query the Main space.
HttpResponseMessage msg = await client.GetAsync($"https://bartendercloud.com/api/librarian/spaces/{spaceId}/folders?includeHidden=true");

if (msg.IsSuccessStatusCode)
{
   var response = await msg.Content.ReadAsStringAsync();
   return JsonConvert.DeserializeObject<FolderHierarchy>(response);
}