Class: AWS.WorkDocs

Inherits:
AWS.Service show all
Identifier:
workdocs
API Version:
2016-05-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using WorkDocs

var workdocs = new AWS.WorkDocs();
workdocs.abortDocumentVersionUpload(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the WorkDocs object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var workdocs = new AWS.WorkDocs({apiVersion: '2016-05-01'});

You can also set the API version globally in AWS.config.apiVersions using the workdocs service identifier:

AWS.config.apiVersions = {
  workdocs: '2016-05-01',
  // other service API versions
};

var workdocs = new AWS.WorkDocs();

Version:

  • 2016-05-01

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.WorkDocs(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a WorkDocs object

var workdocs = new AWS.WorkDocs({apiVersion: '2016-05-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.WorkDocs.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.WorkDocs.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.WorkDocs.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

abortDocumentVersionUpload(params = {}, callback) ⇒ AWS.Request

Aborts the upload of the specified document version that was previously initiated by InitiateDocumentVersionUpload. The client should make this call only when it no longer intends or fails to upload the document version.

Service Reference:

Examples:

Calling the abortDocumentVersionUpload operation

var params = {
  DocumentId: 'STRING_VALUE', /* required */
  VersionId: 'STRING_VALUE' /* required */
};
workdocs.abortDocumentVersionUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

    • VersionId — (String)

      The ID of the version.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

activateUser(params = {}, callback) ⇒ AWS.Request

Activates the specified user. Only active users can access Amazon WorkDocs.

Service Reference:

Examples:

Calling the activateUser operation

var params = {
  UserId: 'STRING_VALUE' /* required */
};
workdocs.activateUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • UserId — (String)

      The ID of the user.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • User — (map)

        The user information.

        • Id — (String)

          The ID of the user.

        • Username — (String)

          The login name of the user.

        • EmailAddress — (String)

          The email address of the user.

        • GivenName — (String)

          The given name of the user.

        • Surname — (String)

          The surname of the user.

        • OrganizationId — (String)

          The ID of the organization.

        • RootFolderId — (String)

          The ID of the root folder.

        • RecycleBinFolderId — (String)

          The ID of the recycle bin folder.

        • Status — (String)

          The status of the user.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "PENDING"
        • Type — (String)

          The type of user.

          Possible values include:
          • "USER"
          • "ADMIN"
        • CreatedTimestamp — (Date)

          The time when the user was created.

        • ModifiedTimestamp — (Date)

          The time when the user was modified.

        • TimeZoneId — (String)

          The time zone ID of the user.

        • Locale — (String)

          The locale of the user.

          Possible values include:
          • "en"
          • "fr"
          • "ko"
          • "de"
          • "es"
          • "ja"
          • "ru"
          • "zh_CN"
          • "zh_TW"
          • "pt_BR"
          • "default"
        • Storage — (map)

          The storage for the user.

          • StorageUtilizedInBytes — (Integer)

            The amount of storage utilized, in bytes.

          • StorageRule — (map)

            The storage for a user.

            • StorageAllocatedInBytes — (Integer)

              The amount of storage allocated, in bytes.

            • StorageType — (String)

              The type of storage.

              Possible values include:
              • "UNLIMITED"
              • "QUOTA"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

addResourcePermissions(params = {}, callback) ⇒ AWS.Request

Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if the principals already have different permissions.

Service Reference:

Examples:

Calling the addResourcePermissions operation

var params = {
  Principals: [ /* required */
    {
      Id: 'STRING_VALUE', /* required */
      Role: VIEWER | CONTRIBUTOR | OWNER | COOWNER, /* required */
      Type: USER | GROUP | INVITE | ANONYMOUS | ORGANIZATION /* required */
    },
    /* more items */
  ],
  ResourceId: 'STRING_VALUE' /* required */
};
workdocs.addResourcePermissions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceId — (String)

      The ID of the resource.

    • Principals — (Array<map>)

      The users, groups, or organization being granted permission.

      • Idrequired — (String)

        The ID of the recipient.

      • Typerequired — (String)

        The type of the recipient.

        Possible values include:
        • "USER"
        • "GROUP"
        • "INVITE"
        • "ANONYMOUS"
        • "ORGANIZATION"
      • Rolerequired — (String)

        The role of the recipient.

        Possible values include:
        • "VIEWER"
        • "CONTRIBUTOR"
        • "OWNER"
        • "COOWNER"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ShareResults — (Array<map>)

        The share results.

        • PrincipalId — (String)

          The ID of the principal.

        • Role — (String)

          The role.

          Possible values include:
          • "VIEWER"
          • "CONTRIBUTOR"
          • "OWNER"
          • "COOWNER"
        • Status — (String)

          The status.

          Possible values include:
          • "SUCCESS"
          • "FAILURE"
        • ShareId — (String)

          The ID of the resource that was shared.

        • StatusMessage — (String)

          The status message.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createFolder(params = {}, callback) ⇒ AWS.Request

Creates a folder with the specified name and parent folder.

Service Reference:

Examples:

Calling the createFolder operation

var params = {
  ParentFolderId: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE'
};
workdocs.createFolder(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name of the new folder.

    • ParentFolderId — (String)

      The ID of the parent folder.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Metadata — (map)

        The metadata of the folder.

        • Id — (String)

          The ID of the folder.

        • Name — (String)

          The name of the folder.

        • CreatorId — (String)

          The ID of the creator.

        • ParentFolderId — (String)

          The ID of the parent folder.

        • CreatedTimestamp — (Date)

          The time when the folder was created.

        • ModifiedTimestamp — (Date)

          The time when the folder was updated.

        • ResourceState — (String)

          The resource state of the folder.

          Possible values include:
          • "ACTIVE"
          • "RESTORING"
          • "RECYCLING"
          • "RECYCLED"
        • Signature — (String)

          The unique identifier created from the subfolders and documents of the folder.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNotificationSubscription(params = {}, callback) ⇒ AWS.Request

Configure WorkDocs to use Amazon SNS notifications.

The endpoint receives a confirmation message, and must confirm the subscription. For more information, see Confirm the Subscription in the Amazon Simple Notification Service Developer Guide.

Service Reference:

Examples:

Calling the createNotificationSubscription operation

var params = {
  Endpoint: 'STRING_VALUE', /* required */
  OrganizationId: 'STRING_VALUE', /* required */
  Protocol: HTTPS, /* required */
  SubscriptionType: ALL /* required */
};
workdocs.createNotificationSubscription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • OrganizationId — (String)

      The ID of the organization.

    • Endpoint — (String)

      The endpoint to receive the notifications. If the protocol is HTTPS, the endpoint is a URL that begins with "https://".

    • Protocol — (String)

      The protocol to use. The supported value is https, which delivers JSON-encoded messasges using HTTPS POST.

      Possible values include:
      • "HTTPS"
    • SubscriptionType — (String)

      The notification type.

      Possible values include:
      • "ALL"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Subscription — (map)

        The subscription.

        • SubscriptionId — (String)

          The ID of the subscription.

        • EndPoint — (String)

          The endpoint of the subscription.

        • Protocol — (String)

          The protocol of the subscription.

          Possible values include:
          • "HTTPS"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createUser(params = {}, callback) ⇒ AWS.Request

Creates a user in a Simple AD or Microsoft AD directory. The status of a newly created user is "ACTIVE". New users can access Amazon WorkDocs.

Service Reference:

Examples:

Calling the createUser operation

var params = {
  GivenName: 'STRING_VALUE', /* required */
  Password: 'STRING_VALUE', /* required */
  Surname: 'STRING_VALUE', /* required */
  Username: 'STRING_VALUE', /* required */
  OrganizationId: 'STRING_VALUE',
  StorageRule: {
    StorageAllocatedInBytes: 0,
    StorageType: UNLIMITED | QUOTA
  },
  TimeZoneId: 'STRING_VALUE'
};
workdocs.createUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • OrganizationId — (String)

      The ID of the organization.

    • Username — (String)

      The login name of the user.

    • GivenName — (String)

      The given name of the user.

    • Surname — (String)

      The surname of the user.

    • Password — (String)

      The password of the user.

    • TimeZoneId — (String)

      The time zone ID of the user.

    • StorageRule — (map)

      The amount of storage for the user.

      • StorageAllocatedInBytes — (Integer)

        The amount of storage allocated, in bytes.

      • StorageType — (String)

        The type of storage.

        Possible values include:
        • "UNLIMITED"
        • "QUOTA"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • User — (map)

        The user information.

        • Id — (String)

          The ID of the user.

        • Username — (String)

          The login name of the user.

        • EmailAddress — (String)

          The email address of the user.

        • GivenName — (String)

          The given name of the user.

        • Surname — (String)

          The surname of the user.

        • OrganizationId — (String)

          The ID of the organization.

        • RootFolderId — (String)

          The ID of the root folder.

        • RecycleBinFolderId — (String)

          The ID of the recycle bin folder.

        • Status — (String)

          The status of the user.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "PENDING"
        • Type — (String)

          The type of user.

          Possible values include:
          • "USER"
          • "ADMIN"
        • CreatedTimestamp — (Date)

          The time when the user was created.

        • ModifiedTimestamp — (Date)

          The time when the user was modified.

        • TimeZoneId — (String)

          The time zone ID of the user.

        • Locale — (String)

          The locale of the user.

          Possible values include:
          • "en"
          • "fr"
          • "ko"
          • "de"
          • "es"
          • "ja"
          • "ru"
          • "zh_CN"
          • "zh_TW"
          • "pt_BR"
          • "default"
        • Storage — (map)

          The storage for the user.

          • StorageUtilizedInBytes — (Integer)

            The amount of storage utilized, in bytes.

          • StorageRule — (map)

            The storage for a user.

            • StorageAllocatedInBytes — (Integer)

              The amount of storage allocated, in bytes.

            • StorageType — (String)

              The type of storage.

              Possible values include:
              • "UNLIMITED"
              • "QUOTA"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deactivateUser(params = {}, callback) ⇒ AWS.Request

Deactivates the specified user, which revokes the user's access to Amazon WorkDocs.

Service Reference:

Examples:

Calling the deactivateUser operation

var params = {
  UserId: 'STRING_VALUE' /* required */
};
workdocs.deactivateUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • UserId — (String)

      The ID of the user.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteDocument(params = {}, callback) ⇒ AWS.Request

Permanently deletes the specified document and its associated metadata.

Service Reference:

Examples:

Calling the deleteDocument operation

var params = {
  DocumentId: 'STRING_VALUE' /* required */
};
workdocs.deleteDocument(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFolder(params = {}, callback) ⇒ AWS.Request

Permanently deletes the specified folder and its contents.

Service Reference:

Examples:

Calling the deleteFolder operation

var params = {
  FolderId: 'STRING_VALUE' /* required */
};
workdocs.deleteFolder(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • FolderId — (String)

      The ID of the folder.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFolderContents(params = {}, callback) ⇒ AWS.Request

Deletes the contents of the specified folder.

Service Reference:

Examples:

Calling the deleteFolderContents operation

var params = {
  FolderId: 'STRING_VALUE' /* required */
};
workdocs.deleteFolderContents(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • FolderId — (String)

      The ID of the folder.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNotificationSubscription(params = {}, callback) ⇒ AWS.Request

Deletes the specified subscription from the specified organization.

Service Reference:

Examples:

Calling the deleteNotificationSubscription operation

var params = {
  OrganizationId: 'STRING_VALUE', /* required */
  SubscriptionId: 'STRING_VALUE' /* required */
};
workdocs.deleteNotificationSubscription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • SubscriptionId — (String)

      The ID of the subscription.

    • OrganizationId — (String)

      The ID of the organization.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteUser(params = {}, callback) ⇒ AWS.Request

Deletes the specified user from a Simple AD or Microsoft AD directory.

Service Reference:

Examples:

Calling the deleteUser operation

var params = {
  UserId: 'STRING_VALUE' /* required */
};
workdocs.deleteUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • UserId — (String)

      The ID of the user.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeDocumentVersions(params = {}, callback) ⇒ AWS.Request

Retrieves the document versions for the specified document.

By default, only active versions are returned.

Service Reference:

Examples:

Calling the describeDocumentVersions operation

var params = {
  DocumentId: 'STRING_VALUE', /* required */
  Fields: 'STRING_VALUE',
  Include: 'STRING_VALUE',
  Limit: 0,
  Marker: 'STRING_VALUE'
};
workdocs.describeDocumentVersions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • Limit — (Integer)

      The maximum number of versions to return with this call.

    • Include — (String)

      A comma-separated list of values. Specify "INITIALIZED" to include incomplete versions.

    • Fields — (String)

      Specify "SOURCE" to include initialized versions and a URL for the source document.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DocumentVersions — (Array<map>)

        The document versions.

        • Id — (String)

          The ID of the version.

        • Name — (String)

          The name of the version.

        • ContentType — (String)

          The content type of the document.

        • Size — (Integer)

          The size of the document, in bytes.

        • Signature — (String)

          The signature of the document.

        • Status — (String)

          The status of the document.

          Possible values include:
          • "INITIALIZED"
          • "ACTIVE"
        • CreatedTimestamp — (Date)

          The time stamp when the document was first uploaded.

        • ModifiedTimestamp — (Date)

          The time stamp when the document was last uploaded.

        • ContentCreatedTimestamp — (Date)

          The time stamp when the content of the document was originally created.

        • ContentModifiedTimestamp — (Date)

          The time stamp when the content of the document was modified.

        • CreatorId — (String)

          The ID of the creator.

        • Thumbnail — (map<String>)

          The thumbnail of the document.

        • Source — (map<String>)

          The source of the document.

      • Marker — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeFolderContents(params = {}, callback) ⇒ AWS.Request

Describes the contents of the specified folder, including its documents and sub-folders.

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.

Service Reference:

Examples:

Calling the describeFolderContents operation

var params = {
  FolderId: 'STRING_VALUE', /* required */
  Include: 'STRING_VALUE',
  Limit: 0,
  Marker: 'STRING_VALUE',
  Order: ASCENDING | DESCENDING,
  Sort: DATE | NAME,
  Type: ALL | DOCUMENT | FOLDER
};
workdocs.describeFolderContents(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • FolderId — (String)

      The ID of the folder.

    • Sort — (String)

      The sorting criteria.

      Possible values include:
      • "DATE"
      • "NAME"
    • Order — (String)

      The order for the contents of the folder.

      Possible values include:
      • "ASCENDING"
      • "DESCENDING"
    • Limit — (Integer)

      The maximum number of items to return with this call.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • Type — (String)

      The type of items.

      Possible values include:
      • "ALL"
      • "DOCUMENT"
      • "FOLDER"
    • Include — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Folders — (Array<map>)

        The sub-folders in the specified folder.

        • Id — (String)

          The ID of the folder.

        • Name — (String)

          The name of the folder.

        • CreatorId — (String)

          The ID of the creator.

        • ParentFolderId — (String)

          The ID of the parent folder.

        • CreatedTimestamp — (Date)

          The time when the folder was created.

        • ModifiedTimestamp — (Date)

          The time when the folder was updated.

        • ResourceState — (String)

          The resource state of the folder.

          Possible values include:
          • "ACTIVE"
          • "RESTORING"
          • "RECYCLING"
          • "RECYCLED"
        • Signature — (String)

          The unique identifier created from the subfolders and documents of the folder.

      • Documents — (Array<map>)

        The documents in the specified folder.

        • Id — (String)

          The ID of the document.

        • CreatorId — (String)

          The ID of the creator.

        • ParentFolderId — (String)

          The ID of the parent folder.

        • CreatedTimestamp — (Date)

          The time when the document was created.

        • ModifiedTimestamp — (Date)

          The time when the document was updated.

        • LatestVersionMetadata — (map)

          The latest version of the document.

          • Id — (String)

            The ID of the version.

          • Name — (String)

            The name of the version.

          • ContentType — (String)

            The content type of the document.

          • Size — (Integer)

            The size of the document, in bytes.

          • Signature — (String)

            The signature of the document.

          • Status — (String)

            The status of the document.

            Possible values include:
            • "INITIALIZED"
            • "ACTIVE"
          • CreatedTimestamp — (Date)

            The time stamp when the document was first uploaded.

          • ModifiedTimestamp — (Date)

            The time stamp when the document was last uploaded.

          • ContentCreatedTimestamp — (Date)

            The time stamp when the content of the document was originally created.

          • ContentModifiedTimestamp — (Date)

            The time stamp when the content of the document was modified.

          • CreatorId — (String)

            The ID of the creator.

          • Thumbnail — (map<String>)

            The thumbnail of the document.

          • Source — (map<String>)

            The source of the document.

        • ResourceState — (String)

          The resource state.

          Possible values include:
          • "ACTIVE"
          • "RESTORING"
          • "RECYCLING"
          • "RECYCLED"
      • Marker — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeNotificationSubscriptions(params = {}, callback) ⇒ AWS.Request

Lists the specified notification subscriptions.

Examples:

Calling the describeNotificationSubscriptions operation

var params = {
  OrganizationId: 'STRING_VALUE', /* required */
  Limit: 0,
  Marker: 'STRING_VALUE'
};
workdocs.describeNotificationSubscriptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • OrganizationId — (String)

      The ID of the organization.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • Limit — (Integer)

      The maximum number of items to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Subscriptions — (Array<map>)

        The subscriptions.

        • SubscriptionId — (String)

          The ID of the subscription.

        • EndPoint — (String)

          The endpoint of the subscription.

        • Protocol — (String)

          The protocol of the subscription.

          Possible values include:
          • "HTTPS"
      • Marker — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeResourcePermissions(params = {}, callback) ⇒ AWS.Request

Describes the permissions of a specified resource.

Service Reference:

Examples:

Calling the describeResourcePermissions operation

var params = {
  ResourceId: 'STRING_VALUE', /* required */
  Limit: 0,
  Marker: 'STRING_VALUE'
};
workdocs.describeResourcePermissions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceId — (String)

      The ID of the resource.

    • Limit — (Integer)

      The maximum number of items to return with this call.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Principals — (Array<map>)

        The principals.

        • Id — (String)

          The ID of the resource.

        • Type — (String)

          The type of resource.

          Possible values include:
          • "USER"
          • "GROUP"
          • "INVITE"
          • "ANONYMOUS"
          • "ORGANIZATION"
        • Roles — (Array<map>)

          The permission information for the resource.

          • Role — (String)

            The role of the user.

            Possible values include:
            • "VIEWER"
            • "CONTRIBUTOR"
            • "OWNER"
            • "COOWNER"
          • Type — (String)

            The type of permissions.

            Possible values include:
            • "DIRECT"
            • "INHERITED"
      • Marker — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeUsers(params = {}, callback) ⇒ AWS.Request

Describes the specified users. You can describe all users or filter the results (for example, by status or organization).

By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response includes a marker that you can use to request the next set of results.

Service Reference:

Examples:

Calling the describeUsers operation

var params = {
  Fields: 'STRING_VALUE',
  Include: ALL | ACTIVE_PENDING,
  Limit: 0,
  Marker: 'STRING_VALUE',
  Order: ASCENDING | DESCENDING,
  OrganizationId: 'STRING_VALUE',
  Query: 'STRING_VALUE',
  Sort: USER_NAME | FULL_NAME | STORAGE_LIMIT | USER_STATUS | STORAGE_USED,
  UserIds: 'STRING_VALUE'
};
workdocs.describeUsers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • OrganizationId — (String)

      The ID of the organization.

    • UserIds — (String)

      The IDs of the users.

    • Query — (String)

      A query to filter users by user name.

    • Include — (String)

      The state of the users. Specify "ALL" to include inactive users.

      Possible values include:
      • "ALL"
      • "ACTIVE_PENDING"
    • Order — (String)

      The order for the results.

      Possible values include:
      • "ASCENDING"
      • "DESCENDING"
    • Sort — (String)

      The sorting criteria.

      Possible values include:
      • "USER_NAME"
      • "FULL_NAME"
      • "STORAGE_LIMIT"
      • "USER_STATUS"
      • "STORAGE_USED"
    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • Limit — (Integer)

      The maximum number of items to return.

    • Fields — (String)

      A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and utilization information.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Users — (Array<map>)

        The users.

        • Id — (String)

          The ID of the user.

        • Username — (String)

          The login name of the user.

        • EmailAddress — (String)

          The email address of the user.

        • GivenName — (String)

          The given name of the user.

        • Surname — (String)

          The surname of the user.

        • OrganizationId — (String)

          The ID of the organization.

        • RootFolderId — (String)

          The ID of the root folder.

        • RecycleBinFolderId — (String)

          The ID of the recycle bin folder.

        • Status — (String)

          The status of the user.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "PENDING"
        • Type — (String)

          The type of user.

          Possible values include:
          • "USER"
          • "ADMIN"
        • CreatedTimestamp — (Date)

          The time when the user was created.

        • ModifiedTimestamp — (Date)

          The time when the user was modified.

        • TimeZoneId — (String)

          The time zone ID of the user.

        • Locale — (String)

          The locale of the user.

          Possible values include:
          • "en"
          • "fr"
          • "ko"
          • "de"
          • "es"
          • "ja"
          • "ru"
          • "zh_CN"
          • "zh_TW"
          • "pt_BR"
          • "default"
        • Storage — (map)

          The storage for the user.

          • StorageUtilizedInBytes — (Integer)

            The amount of storage utilized, in bytes.

          • StorageRule — (map)

            The storage for a user.

            • StorageAllocatedInBytes — (Integer)

              The amount of storage allocated, in bytes.

            • StorageType — (String)

              The type of storage.

              Possible values include:
              • "UNLIMITED"
              • "QUOTA"
      • TotalNumberOfUsers — (Integer)

        The total number of users included in the results.

      • Marker — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDocument(params = {}, callback) ⇒ AWS.Request

Retrieves the specified document object.

Service Reference:

Examples:

Calling the getDocument operation

var params = {
  DocumentId: 'STRING_VALUE' /* required */
};
workdocs.getDocument(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document object.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Metadata — (map)

        The document object.

        • Id — (String)

          The ID of the document.

        • CreatorId — (String)

          The ID of the creator.

        • ParentFolderId — (String)

          The ID of the parent folder.

        • CreatedTimestamp — (Date)

          The time when the document was created.

        • ModifiedTimestamp — (Date)

          The time when the document was updated.

        • LatestVersionMetadata — (map)

          The latest version of the document.

          • Id — (String)

            The ID of the version.

          • Name — (String)

            The name of the version.

          • ContentType — (String)

            The content type of the document.

          • Size — (Integer)

            The size of the document, in bytes.

          • Signature — (String)

            The signature of the document.

          • Status — (String)

            The status of the document.

            Possible values include:
            • "INITIALIZED"
            • "ACTIVE"
          • CreatedTimestamp — (Date)

            The time stamp when the document was first uploaded.

          • ModifiedTimestamp — (Date)

            The time stamp when the document was last uploaded.

          • ContentCreatedTimestamp — (Date)

            The time stamp when the content of the document was originally created.

          • ContentModifiedTimestamp — (Date)

            The time stamp when the content of the document was modified.

          • CreatorId — (String)

            The ID of the creator.

          • Thumbnail — (map<String>)

            The thumbnail of the document.

          • Source — (map<String>)

            The source of the document.

        • ResourceState — (String)

          The resource state.

          Possible values include:
          • "ACTIVE"
          • "RESTORING"
          • "RECYCLING"
          • "RECYCLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDocumentPath(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the getDocumentPath operation

var params = {
  DocumentId: 'STRING_VALUE', /* required */
  Fields: 'STRING_VALUE',
  Limit: 0,
  Marker: 'STRING_VALUE'
};
workdocs.getDocumentPath(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

    • Limit — (Integer)

      The maximum number of levels in the hierarchy to return.

    • Fields — (String)

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

    • Marker — (String)

      This value is not supported.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Path — (map)

        The path information.

        • Components — (Array<map>)

          The components of the resource path.

          • Id — (String)

            The ID of the resource path.

          • Name — (String)

            The name of the resource path.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDocumentVersion(params = {}, callback) ⇒ AWS.Request

Retrieves version metadata for the specified document.

Service Reference:

Examples:

Calling the getDocumentVersion operation

var params = {
  DocumentId: 'STRING_VALUE', /* required */
  VersionId: 'STRING_VALUE', /* required */
  Fields: 'STRING_VALUE'
};
workdocs.getDocumentVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

    • VersionId — (String)

      The version ID of the document.

    • Fields — (String)

      A comma-separated list of values. Specify "SOURCE" to include a URL for the source document.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Metadata — (map)

        The version metadata.

        • Id — (String)

          The ID of the version.

        • Name — (String)

          The name of the version.

        • ContentType — (String)

          The content type of the document.

        • Size — (Integer)

          The size of the document, in bytes.

        • Signature — (String)

          The signature of the document.

        • Status — (String)

          The status of the document.

          Possible values include:
          • "INITIALIZED"
          • "ACTIVE"
        • CreatedTimestamp — (Date)

          The time stamp when the document was first uploaded.

        • ModifiedTimestamp — (Date)

          The time stamp when the document was last uploaded.

        • ContentCreatedTimestamp — (Date)

          The time stamp when the content of the document was originally created.

        • ContentModifiedTimestamp — (Date)

          The time stamp when the content of the document was modified.

        • CreatorId — (String)

          The ID of the creator.

        • Thumbnail — (map<String>)

          The thumbnail of the document.

        • Source — (map<String>)

          The source of the document.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getFolder(params = {}, callback) ⇒ AWS.Request

Retrieves the metadata of the specified folder.

Service Reference:

Examples:

Calling the getFolder operation

var params = {
  FolderId: 'STRING_VALUE' /* required */
};
workdocs.getFolder(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • FolderId — (String)

      The ID of the folder.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Metadata — (map)

        The metadata of the folder.

        • Id — (String)

          The ID of the folder.

        • Name — (String)

          The name of the folder.

        • CreatorId — (String)

          The ID of the creator.

        • ParentFolderId — (String)

          The ID of the parent folder.

        • CreatedTimestamp — (Date)

          The time when the folder was created.

        • ModifiedTimestamp — (Date)

          The time when the folder was updated.

        • ResourceState — (String)

          The resource state of the folder.

          Possible values include:
          • "ACTIVE"
          • "RESTORING"
          • "RECYCLING"
          • "RECYCLED"
        • Signature — (String)

          The unique identifier created from the subfolders and documents of the folder.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getFolderPath(params = {}, callback) ⇒ AWS.Request

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

By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested folder 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 parent folder names.

Service Reference:

Examples:

Calling the getFolderPath operation

var params = {
  FolderId: 'STRING_VALUE', /* required */
  Fields: 'STRING_VALUE',
  Limit: 0,
  Marker: 'STRING_VALUE'
};
workdocs.getFolderPath(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • FolderId — (String)

      The ID of the folder.

    • Limit — (Integer)

      The maximum number of levels in the hierarchy to return.

    • Fields — (String)

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

    • Marker — (String)

      This value is not supported.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Path — (map)

        The path information.

        • Components — (Array<map>)

          The components of the resource path.

          • Id — (String)

            The ID of the resource path.

          • Name — (String)

            The name of the resource path.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

initiateDocumentVersionUpload(params = {}, callback) ⇒ AWS.Request

Creates a new document object and version object.

The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when creating a new version of an existing document. This is the first step to upload a document. Next, upload the document to the URL returned from the call, and then call UpdateDocumentVersion.

To cancel the document upload, call AbortDocumentVersionUpload.

Service Reference:

Examples:

Calling the initiateDocumentVersionUpload operation

var params = {
  ParentFolderId: 'STRING_VALUE', /* required */
  ContentCreatedTimestamp: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  ContentModifiedTimestamp: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  ContentType: 'STRING_VALUE',
  DocumentSizeInBytes: 0,
  Id: 'STRING_VALUE',
  Name: 'STRING_VALUE'
};
workdocs.initiateDocumentVersionUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Id — (String)

      The ID of the document.

    • Name — (String)

      The name of the document.

    • ContentCreatedTimestamp — (Date)

      The time stamp when the content of the document was originally created.

    • ContentModifiedTimestamp — (Date)

      The time stamp when the content of the document was modified.

    • ContentType — (String)

      The content type of the document.

    • DocumentSizeInBytes — (Integer)

      The size of the document, in bytes.

    • ParentFolderId — (String)

      The ID of the parent folder.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Metadata — (map)

        The document metadata.

        • Id — (String)

          The ID of the document.

        • CreatorId — (String)

          The ID of the creator.

        • ParentFolderId — (String)

          The ID of the parent folder.

        • CreatedTimestamp — (Date)

          The time when the document was created.

        • ModifiedTimestamp — (Date)

          The time when the document was updated.

        • LatestVersionMetadata — (map)

          The latest version of the document.

          • Id — (String)

            The ID of the version.

          • Name — (String)

            The name of the version.

          • ContentType — (String)

            The content type of the document.

          • Size — (Integer)

            The size of the document, in bytes.

          • Signature — (String)

            The signature of the document.

          • Status — (String)

            The status of the document.

            Possible values include:
            • "INITIALIZED"
            • "ACTIVE"
          • CreatedTimestamp — (Date)

            The time stamp when the document was first uploaded.

          • ModifiedTimestamp — (Date)

            The time stamp when the document was last uploaded.

          • ContentCreatedTimestamp — (Date)

            The time stamp when the content of the document was originally created.

          • ContentModifiedTimestamp — (Date)

            The time stamp when the content of the document was modified.

          • CreatorId — (String)

            The ID of the creator.

          • Thumbnail — (map<String>)

            The thumbnail of the document.

          • Source — (map<String>)

            The source of the document.

        • ResourceState — (String)

          The resource state.

          Possible values include:
          • "ACTIVE"
          • "RESTORING"
          • "RECYCLING"
          • "RECYCLED"
      • UploadMetadata — (map)

        The upload metadata.

        • UploadUrl — (String)

          The URL of the upload.

        • SignedHeaders — (map<String>)

          The signed headers.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

removeAllResourcePermissions(params = {}, callback) ⇒ AWS.Request

Removes all the permissions from the specified resource.

Service Reference:

Examples:

Calling the removeAllResourcePermissions operation

var params = {
  ResourceId: 'STRING_VALUE' /* required */
};
workdocs.removeAllResourcePermissions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceId — (String)

      The ID of the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

removeResourcePermission(params = {}, callback) ⇒ AWS.Request

Removes the permission for the specified principal from the specified resource.

Service Reference:

Examples:

Calling the removeResourcePermission operation

var params = {
  PrincipalId: 'STRING_VALUE', /* required */
  ResourceId: 'STRING_VALUE', /* required */
  PrincipalType: USER | GROUP | INVITE | ANONYMOUS | ORGANIZATION
};
workdocs.removeResourcePermission(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceId — (String)

      The ID of the resource.

    • PrincipalId — (String)

      The principal ID of the resource.

    • PrincipalType — (String)

      The principal type of the resource.

      Possible values include:
      • "USER"
      • "GROUP"
      • "INVITE"
      • "ANONYMOUS"
      • "ORGANIZATION"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDocument(params = {}, callback) ⇒ AWS.Request

Updates the specified attributes of the specified document. The user must have access to both the document and its parent folder, if applicable.

Service Reference:

Examples:

Calling the updateDocument operation

var params = {
  DocumentId: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE',
  ParentFolderId: 'STRING_VALUE',
  ResourceState: ACTIVE | RESTORING | RECYCLING | RECYCLED
};
workdocs.updateDocument(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

    • Name — (String)

      The name of the document.

    • ParentFolderId — (String)

      The ID of the parent folder.

    • ResourceState — (String)

      The resource state of the document. Note that only ACTIVE and RECYCLED are supported.

      Possible values include:
      • "ACTIVE"
      • "RESTORING"
      • "RECYCLING"
      • "RECYCLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDocumentVersion(params = {}, callback) ⇒ AWS.Request

Changes the status of the document version to ACTIVE.

Amazon WorkDocs also sets its document container to ACTIVE. This is the last step in a document upload, after the client uploads the document to an S3-presigned URL returned by InitiateDocumentVersionUpload.

Service Reference:

Examples:

Calling the updateDocumentVersion operation

var params = {
  DocumentId: 'STRING_VALUE', /* required */
  VersionId: 'STRING_VALUE', /* required */
  VersionStatus: ACTIVE
};
workdocs.updateDocumentVersion(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DocumentId — (String)

      The ID of the document.

    • VersionId — (String)

      The version ID of the document.

    • VersionStatus — (String)

      The status of the version.

      Possible values include:
      • "ACTIVE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateFolder(params = {}, callback) ⇒ AWS.Request

Updates the specified attributes of the specified folder. The user must have access to both the folder and its parent folder, if applicable.

Service Reference:

Examples:

Calling the updateFolder operation

var params = {
  FolderId: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE',
  ParentFolderId: 'STRING_VALUE',
  ResourceState: ACTIVE | RESTORING | RECYCLING | RECYCLED
};
workdocs.updateFolder(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • FolderId — (String)

      The ID of the folder.

    • Name — (String)

      The name of the folder.

    • ParentFolderId — (String)

      The ID of the parent folder.

    • ResourceState — (String)

      The resource state of the folder. Note that only ACTIVE and RECYCLED are accepted values from the API.

      Possible values include:
      • "ACTIVE"
      • "RESTORING"
      • "RECYCLING"
      • "RECYCLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateUser(params = {}, callback) ⇒ AWS.Request

Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the Amazon WorkDocs site.

Service Reference:

Examples:

Calling the updateUser operation

var params = {
  UserId: 'STRING_VALUE', /* required */
  GivenName: 'STRING_VALUE',
  Locale: en | fr | ko | de | es | ja | ru | zh_CN | zh_TW | pt_BR | default,
  StorageRule: {
    StorageAllocatedInBytes: 0,
    StorageType: UNLIMITED | QUOTA
  },
  Surname: 'STRING_VALUE',
  TimeZoneId: 'STRING_VALUE',
  Type: USER | ADMIN
};
workdocs.updateUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • UserId — (String)

      The ID of the user.

    • GivenName — (String)

      The given name of the user.

    • Surname — (String)

      The surname of the user.

    • Type — (String)

      The type of the user.

      Possible values include:
      • "USER"
      • "ADMIN"
    • StorageRule — (map)

      The amount of storage for the user.

      • StorageAllocatedInBytes — (Integer)

        The amount of storage allocated, in bytes.

      • StorageType — (String)

        The type of storage.

        Possible values include:
        • "UNLIMITED"
        • "QUOTA"
    • TimeZoneId — (String)

      The time zone ID of the user.

    • Locale — (String)

      The locale of the user.

      Possible values include:
      • "en"
      • "fr"
      • "ko"
      • "de"
      • "es"
      • "ja"
      • "ru"
      • "zh_CN"
      • "zh_TW"
      • "pt_BR"
      • "default"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • User — (map)

        The user information.

        • Id — (String)

          The ID of the user.

        • Username — (String)

          The login name of the user.

        • EmailAddress — (String)

          The email address of the user.

        • GivenName — (String)

          The given name of the user.

        • Surname — (String)

          The surname of the user.

        • OrganizationId — (String)

          The ID of the organization.

        • RootFolderId — (String)

          The ID of the root folder.

        • RecycleBinFolderId — (String)

          The ID of the recycle bin folder.

        • Status — (String)

          The status of the user.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "PENDING"
        • Type — (String)

          The type of user.

          Possible values include:
          • "USER"
          • "ADMIN"
        • CreatedTimestamp — (Date)

          The time when the user was created.

        • ModifiedTimestamp — (Date)

          The time when the user was modified.

        • TimeZoneId — (String)

          The time zone ID of the user.

        • Locale — (String)

          The locale of the user.

          Possible values include:
          • "en"
          • "fr"
          • "ko"
          • "de"
          • "es"
          • "ja"
          • "ru"
          • "zh_CN"
          • "zh_TW"
          • "pt_BR"
          • "default"
        • Storage — (map)

          The storage for the user.

          • StorageUtilizedInBytes — (Integer)

            The amount of storage utilized, in bytes.

          • StorageRule — (map)

            The storage for a user.

            • StorageAllocatedInBytes — (Integer)

              The amount of storage allocated, in bytes.

            • StorageType — (String)

              The type of storage.

              Possible values include:
              • "UNLIMITED"
              • "QUOTA"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.