DescribeFolderContentsCommand

Describes the contents of the specified folder, including its documents and subfolders.

By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more results, the response includes a marker that you can use to request the next set of results. You can also request initialized documents.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { WorkDocsClient, DescribeFolderContentsCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, DescribeFolderContentsCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // DescribeFolderContentsRequest
  AuthenticationToken: "STRING_VALUE",
  FolderId: "STRING_VALUE", // required
  Sort: "DATE" || "NAME",
  Order: "ASCENDING" || "DESCENDING",
  Limit: Number("int"),
  Marker: "STRING_VALUE",
  Type: "ALL" || "DOCUMENT" || "FOLDER",
  Include: "STRING_VALUE",
};
const command = new DescribeFolderContentsCommand(input);
const response = await client.send(command);
// { // DescribeFolderContentsResponse
//   Folders: [ // FolderMetadataList
//     { // FolderMetadata
//       Id: "STRING_VALUE",
//       Name: "STRING_VALUE",
//       CreatorId: "STRING_VALUE",
//       ParentFolderId: "STRING_VALUE",
//       CreatedTimestamp: new Date("TIMESTAMP"),
//       ModifiedTimestamp: new Date("TIMESTAMP"),
//       ResourceState: "ACTIVE" || "RESTORING" || "RECYCLING" || "RECYCLED",
//       Signature: "STRING_VALUE",
//       Labels: [ // SharedLabels
//         "STRING_VALUE",
//       ],
//       Size: Number("long"),
//       LatestVersionSize: Number("long"),
//     },
//   ],
//   Documents: [ // DocumentMetadataList
//     { // DocumentMetadata
//       Id: "STRING_VALUE",
//       CreatorId: "STRING_VALUE",
//       ParentFolderId: "STRING_VALUE",
//       CreatedTimestamp: new Date("TIMESTAMP"),
//       ModifiedTimestamp: new Date("TIMESTAMP"),
//       LatestVersionMetadata: { // DocumentVersionMetadata
//         Id: "STRING_VALUE",
//         Name: "STRING_VALUE",
//         ContentType: "STRING_VALUE",
//         Size: Number("long"),
//         Signature: "STRING_VALUE",
//         Status: "INITIALIZED" || "ACTIVE",
//         CreatedTimestamp: new Date("TIMESTAMP"),
//         ModifiedTimestamp: new Date("TIMESTAMP"),
//         ContentCreatedTimestamp: new Date("TIMESTAMP"),
//         ContentModifiedTimestamp: new Date("TIMESTAMP"),
//         CreatorId: "STRING_VALUE",
//         Thumbnail: { // DocumentThumbnailUrlMap
//           "<keys>": "STRING_VALUE",
//         },
//         Source: { // DocumentSourceUrlMap
//           "<keys>": "STRING_VALUE",
//         },
//       },
//       ResourceState: "ACTIVE" || "RESTORING" || "RECYCLING" || "RECYCLED",
//       Labels: [
//         "STRING_VALUE",
//       ],
//     },
//   ],
//   Marker: "STRING_VALUE",
// };

DescribeFolderContentsCommand Input

Parameter
Type
Description
FolderId
Required
string | undefined

The ID of the folder.

AuthenticationToken
string | undefined

Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

Include
string | undefined

The contents to include. Specify "INITIALIZED" to include initialized documents.

Limit
number | undefined

The maximum number of items to return with this call.

Marker
string | undefined

The marker for the next set of results. This marker was received from a previous call.

Order
OrderType | undefined

The order for the contents of the folder.

Sort
ResourceSortType | undefined

The sorting criteria.

Type
FolderContentType | undefined

The type of items.

DescribeFolderContentsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Documents
DocumentMetadata[] | undefined

The documents in the specified folder.

Folders
FolderMetadata[] | undefined

The subfolders in the specified folder.

Marker
string | undefined

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Throws

Name
Fault
Details
EntityNotExistsException
client

The resource does not exist.

FailedDependencyException
client

The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.

InvalidArgumentException
client

The pagination marker or limit fields are not valid.

ProhibitedStateException
client

The specified document version is not in the INITIALIZED state.

ServiceUnavailableException
server

One or more of the dependencies is unavailable.

UnauthorizedResourceAccessException
client

The caller does not have access to perform the action on the resource.

WorkDocsServiceException
Base exception class for all service exceptions from WorkDocs service.