- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DescribeDocumentVersionsCommand
Retrieves the document versions for the specified document.
By default, only active versions are returned.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { WorkDocsClient, DescribeDocumentVersionsCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, DescribeDocumentVersionsCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // DescribeDocumentVersionsRequest
AuthenticationToken: "STRING_VALUE",
DocumentId: "STRING_VALUE", // required
Marker: "STRING_VALUE",
Limit: Number("int"),
Include: "STRING_VALUE",
Fields: "STRING_VALUE",
};
const command = new DescribeDocumentVersionsCommand(input);
const response = await client.send(command);
// { // DescribeDocumentVersionsResponse
// DocumentVersions: [ // DocumentVersionMetadataList
// { // 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",
// },
// },
// ],
// Marker: "STRING_VALUE",
// };
DescribeDocumentVersionsCommand Input
Parameter | Type | Description |
---|
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 | Specify "SOURCE" to include initialized versions and a URL for the source document. |
Include | string | undefined | A comma-separated list of values. Specify "INITIALIZED" to include incomplete versions. |
Limit | number | undefined | The maximum number of versions to return with this call. |
Marker | string | undefined | The marker for the next set of results. (You received this marker from a previous call.) |
DescribeDocumentVersionsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DocumentVersions | DocumentVersionMetadata[] | undefined | The document versions. |
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 |
---|
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. |
InvalidPasswordException | client | The password is invalid. |
ProhibitedStateException | client | The specified document version is not in the INITIALIZED state. |
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. |