SearchResources - Amazon WorkDocs

SearchResources

Important

Notice: New customer sign-ups and account upgrades are no longer available for Amazon WorkDocs. Learn about migration steps here: How to migrate data from Amazon WorkDocs.

Searches metadata and the content of folders, documents, document versions, and comments.

Request Syntax

POST /api/v1/search HTTP/1.1 Authentication: AuthenticationToken Content-type: application/json { "AdditionalResponseFields": [ "string" ], "Filters": { "AncestorIds": [ "string" ], "ContentCategories": [ "string" ], "CreatedRange": { "EndValue": number, "StartValue": number }, "Labels": [ "string" ], "ModifiedRange": { "EndValue": number, "StartValue": number }, "Principals": [ { "Id": "string", "Roles": [ "string" ] } ], "ResourceTypes": [ "string" ], "SearchCollectionTypes": [ "string" ], "SizeRange": { "EndValue": number, "StartValue": number }, "TextLocales": [ "string" ] }, "Limit": number, "Marker": "string", "OrderBy": [ { "Field": "string", "Order": "string" } ], "OrganizationId": "string", "QueryScopes": [ "string" ], "QueryText": "string" }

URI Request Parameters

The request uses the following URI parameters.

AuthenticationToken

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

Length Constraints: Minimum length of 1. Maximum length of 8199.

Request Body

The request accepts the following data in JSON format.

AdditionalResponseFields

A list of attributes to include in the response. Used to request fields that are not normally returned in a standard response.

Type: Array of strings

Valid Values: WEBURL

Required: No

Filters

Filters results based on entity metadata.

Type: Filters object

Required: No

Limit

Max results count per page.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

Marker

The marker for the next set of results.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [\d]+

Required: No

OrderBy

Order by results in one or more categories.

Type: Array of SearchSortResult objects

Array Members: Maximum number of 1 item.

Required: No

OrganizationId

Filters based on the resource owner OrgId. This is a mandatory parameter when using Admin SigV4 credentials.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [&\w+-.@]+

Required: No

QueryScopes

Filter based on the text field type. A Folder has only a name and no content. A Comment has only content and no name. A Document or Document Version has a name and content

Type: Array of strings

Array Members: Maximum number of 2 items.

Valid Values: NAME | CONTENT

Required: No

QueryText

The String to search for. Searches across different text fields based on request parameters. Use double quotes around the query string for exact phrase matches.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Pattern: [\u0020-\uFFFF]+

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "Items": [ { "CommentMetadata": { "CommentId": "string", "CommentStatus": "string", "Contributor": { "CreatedTimestamp": number, "EmailAddress": "string", "GivenName": "string", "Id": "string", "Locale": "string", "ModifiedTimestamp": number, "OrganizationId": "string", "RecycleBinFolderId": "string", "RootFolderId": "string", "Status": "string", "Storage": { "StorageRule": { "StorageAllocatedInBytes": number, "StorageType": "string" }, "StorageUtilizedInBytes": number }, "Surname": "string", "TimeZoneId": "string", "Type": "string", "Username": "string" }, "ContributorId": "string", "CreatedTimestamp": number, "RecipientId": "string" }, "DocumentMetadata": { "CreatedTimestamp": number, "CreatorId": "string", "Id": "string", "Labels": [ "string" ], "LatestVersionMetadata": { "ContentCreatedTimestamp": number, "ContentModifiedTimestamp": number, "ContentType": "string", "CreatedTimestamp": number, "CreatorId": "string", "Id": "string", "ModifiedTimestamp": number, "Name": "string", "Signature": "string", "Size": number, "Source": { "string" : "string" }, "Status": "string", "Thumbnail": { "string" : "string" } }, "ModifiedTimestamp": number, "ParentFolderId": "string", "ResourceState": "string" }, "DocumentVersionMetadata": { "ContentCreatedTimestamp": number, "ContentModifiedTimestamp": number, "ContentType": "string", "CreatedTimestamp": number, "CreatorId": "string", "Id": "string", "ModifiedTimestamp": number, "Name": "string", "Signature": "string", "Size": number, "Source": { "string" : "string" }, "Status": "string", "Thumbnail": { "string" : "string" } }, "FolderMetadata": { "CreatedTimestamp": number, "CreatorId": "string", "Id": "string", "Labels": [ "string" ], "LatestVersionSize": number, "ModifiedTimestamp": number, "Name": "string", "ParentFolderId": "string", "ResourceState": "string", "Signature": "string", "Size": number }, "ResourceType": "string", "WebUrl": "string" } ], "Marker": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Items

List of Documents, Folders, Comments, and Document Versions matching the query.

Type: Array of ResponseItem objects

Array Members: Maximum number of 100 items.

Marker

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [\d]+

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidArgumentException

The pagination marker or limit fields are not valid.

HTTP Status Code: 400

ServiceUnavailableException

One or more of the dependencies is unavailable.

HTTP Status Code: 503

UnauthorizedOperationException

The operation is not permitted.

HTTP Status Code: 403

UnauthorizedResourceAccessException

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

HTTP Status Code: 404

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: