GetDocumentPathCommand

Retrieves the path information (the hierarchy from the root folder) for the requested document.

By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the names of the parent folders.

Example Syntax

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

import { WorkDocsClient, GetDocumentPathCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, GetDocumentPathCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // GetDocumentPathRequest
  AuthenticationToken: "STRING_VALUE",
  DocumentId: "STRING_VALUE", // required
  Limit: Number("int"),
  Fields: "STRING_VALUE",
  Marker: "STRING_VALUE",
};
const command = new GetDocumentPathCommand(input);
const response = await client.send(command);
// { // GetDocumentPathResponse
//   Path: { // ResourcePath
//     Components: [ // ResourcePathComponentList
//       { // ResourcePathComponent
//         Id: "STRING_VALUE",
//         Name: "STRING_VALUE",
//       },
//     ],
//   },
// };

GetDocumentPathCommand Input

See GetDocumentPathCommandInput for more details

Parameter
Type
Description
DocumentId
Required
string | undefined

The ID of the document.

AuthenticationToken
string | undefined

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

Fields
string | undefined

A comma-separated list of values. Specify NAME to include the names of the parent folders.

Limit
number | undefined

The maximum number of levels in the hierarchy to return.

Marker
string | undefined

This value is not supported.

GetDocumentPathCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Path
ResourcePath | undefined

The path information.

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.

ServiceUnavailableException
server

One or more of the dependencies is unavailable.

UnauthorizedOperationException
client

The operation is not permitted.

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.