Amazon WorkDocs

2017/06/20 - Amazon WorkDocs - 3 new api methods

Changes  This release provides a new API to retrieve the activities performed by WorkDocs users.

GetCurrentUser (new) Link ¶

Retrieves details of the current user for whom the authentication token was generated. This is not a valid action for SigV4 (administrative API) clients.

See also: AWS API Documentation

Request Syntax

client.get_current_user(
    AuthenticationToken='string'
)
type AuthenticationToken

string

param AuthenticationToken

[REQUIRED]

Amazon WorkDocs authentication token.

rtype

dict

returns

Response Syntax

{
    'User': {
        'Id': 'string',
        'Username': 'string',
        'EmailAddress': 'string',
        'GivenName': 'string',
        'Surname': 'string',
        'OrganizationId': 'string',
        'RootFolderId': 'string',
        'RecycleBinFolderId': 'string',
        'Status': 'ACTIVE'|'INACTIVE'|'PENDING',
        'Type': 'USER'|'ADMIN',
        'CreatedTimestamp': datetime(2015, 1, 1),
        'ModifiedTimestamp': datetime(2015, 1, 1),
        'TimeZoneId': 'string',
        'Locale': 'en'|'fr'|'ko'|'de'|'es'|'ja'|'ru'|'zh_CN'|'zh_TW'|'pt_BR'|'default',
        'Storage': {
            'StorageUtilizedInBytes': 123,
            'StorageRule': {
                'StorageAllocatedInBytes': 123,
                'StorageType': 'UNLIMITED'|'QUOTA'
            }
        }
    }
}

Response Structure

  • (dict) --

    • User (dict) --

      Metadata of the user.

      • 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.

      • Type (string) --

        The type of user.

      • CreatedTimestamp (datetime) --

        The time when the user was created.

      • ModifiedTimestamp (datetime) --

        The time when the user was modified.

      • TimeZoneId (string) --

        The time zone ID of the user.

      • Locale (string) --

        The locale of the user.

      • Storage (dict) --

        The storage for the user.

        • StorageUtilizedInBytes (integer) --

          The amount of storage utilized, in bytes.

        • StorageRule (dict) --

          The storage for a user.

          • StorageAllocatedInBytes (integer) --

            The amount of storage allocated, in bytes.

          • StorageType (string) --

            The type of storage.

DescribeRootFolders (new) Link ¶

Describes the current user's special folders; the RootFolder and the RecyleBin . RootFolder is the root of user's files and folders and RecyleBin is the root of recycled items. This is not a valid action for SigV4 (administrative API) clients.

See also: AWS API Documentation

Request Syntax

client.describe_root_folders(
    AuthenticationToken='string',
    Limit=123,
    Marker='string'
)
type AuthenticationToken

string

param AuthenticationToken

[REQUIRED]

Amazon WorkDocs authentication token. This field should not be set when using administrative API actions, as in accessing the API using AWS credentials.

type Limit

integer

param Limit

The maximum number of items to return.

type Marker

string

param Marker

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

rtype

dict

returns

Response Syntax

{
    'Folders': [
        {
            'Id': 'string',
            'Name': 'string',
            'CreatorId': 'string',
            'ParentFolderId': 'string',
            'CreatedTimestamp': datetime(2015, 1, 1),
            'ModifiedTimestamp': datetime(2015, 1, 1),
            'ResourceState': 'ACTIVE'|'RESTORING'|'RECYCLING'|'RECYCLED',
            'Signature': 'string',
            'Labels': [
                'string',
            ],
            'Size': 123,
            'LatestVersionSize': 123
        },
    ],
    'Marker': 'string'
}

Response Structure

  • (dict) --

    • Folders (list) --

      The user's special folders.

      • (dict) --

        Describes a 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 (datetime) --

          The time when the folder was created.

        • ModifiedTimestamp (datetime) --

          The time when the folder was updated.

        • ResourceState (string) --

          The resource state of the folder.

        • Signature (string) --

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

        • Labels (list) --

          List of labels on the folder.

          • (string) --

        • Size (integer) --

          The size of the folder metadata.

        • LatestVersionSize (integer) --

          The size of the latest version of the folder metadata.

    • Marker (string) --

      The marker for the next set of results.

DescribeActivities (new) Link ¶

Describes the user activities in a specified time period.

See also: AWS API Documentation

Request Syntax

client.describe_activities(
    AuthenticationToken='string',
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    OrganizationId='string',
    UserId='string',
    Limit=123,
    Marker='string'
)
type AuthenticationToken

string

param AuthenticationToken

Amazon WorkDocs authentication token. This field should not be set when using administrative API actions, as in accessing the API using AWS credentials.

type StartTime

datetime

param StartTime

The timestamp that determines the starting time of the activities; the response includes the activities performed after the specified timestamp.

type EndTime

datetime

param EndTime

The timestamp that determines the end time of the activities; the response includes the activities performed before the specified timestamp.

type OrganizationId

string

param OrganizationId

The ID of the organization. This is a mandatory parameter when using administrative API (SigV4) requests.

type UserId

string

param UserId

The ID of the user who performed the action. The response includes activities pertaining to this user. This is an optional parameter and is only applicable for administrative API (SigV4) requests.

type Limit

integer

param Limit

The maximum number of items to return.

type Marker

string

param Marker

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

rtype

dict

returns

Response Syntax

{
    'UserActivities': [
        {
            'Type': 'DOCUMENT_CHECKED_IN'|'DOCUMENT_CHECKED_OUT'|'DOCUMENT_RENAMED'|'DOCUMENT_VERSION_UPLOADED'|'DOCUMENT_VERSION_DELETED'|'DOCUMENT_RECYCLED'|'DOCUMENT_RESTORED'|'DOCUMENT_REVERTED'|'DOCUMENT_SHARED'|'DOCUMENT_UNSHARED'|'DOCUMENT_SHARE_PERMISSION_CHANGED'|'DOCUMENT_SHAREABLE_LINK_CREATED'|'DOCUMENT_SHAREABLE_LINK_REMOVED'|'DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED'|'DOCUMENT_MOVED'|'DOCUMENT_COMMENT_ADDED'|'DOCUMENT_COMMENT_DELETED'|'DOCUMENT_ANNOTATION_ADDED'|'DOCUMENT_ANNOTATION_DELETED'|'FOLDER_CREATED'|'FOLDER_DELETED'|'FOLDER_RENAMED'|'FOLDER_RECYCLED'|'FOLDER_RESTORED'|'FOLDER_SHARED'|'FOLDER_UNSHARED'|'FOLDER_SHARE_PERMISSION_CHANGED'|'FOLDER_SHAREABLE_LINK_CREATED'|'FOLDER_SHAREABLE_LINK_REMOVED'|'FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED'|'FOLDER_MOVED',
            'TimeStamp': datetime(2015, 1, 1),
            'OrganizationId': 'string',
            'Initiator': {
                'Id': 'string',
                'Username': 'string',
                'GivenName': 'string',
                'Surname': 'string',
                'EmailAddress': 'string'
            },
            'Participants': {
                'Users': [
                    {
                        'Id': 'string',
                        'Username': 'string',
                        'GivenName': 'string',
                        'Surname': 'string',
                        'EmailAddress': 'string'
                    },
                ],
                'Groups': [
                    {
                        'Id': 'string',
                        'Name': 'string'
                    },
                ]
            },
            'ResourceMetadata': {
                'Type': 'FOLDER'|'DOCUMENT',
                'Name': 'string',
                'OriginalName': 'string',
                'Id': 'string',
                'VersionId': 'string',
                'Owner': {
                    'Id': 'string',
                    'Username': 'string',
                    'GivenName': 'string',
                    'Surname': 'string',
                    'EmailAddress': 'string'
                },
                'ParentId': 'string'
            },
            'OriginalParent': {
                'Type': 'FOLDER'|'DOCUMENT',
                'Name': 'string',
                'OriginalName': 'string',
                'Id': 'string',
                'VersionId': 'string',
                'Owner': {
                    'Id': 'string',
                    'Username': 'string',
                    'GivenName': 'string',
                    'Surname': 'string',
                    'EmailAddress': 'string'
                },
                'ParentId': 'string'
            },
            'CommentMetadata': {
                'CommentId': 'string',
                'Contributor': {
                    'Id': 'string',
                    'Username': 'string',
                    'EmailAddress': 'string',
                    'GivenName': 'string',
                    'Surname': 'string',
                    'OrganizationId': 'string',
                    'RootFolderId': 'string',
                    'RecycleBinFolderId': 'string',
                    'Status': 'ACTIVE'|'INACTIVE'|'PENDING',
                    'Type': 'USER'|'ADMIN',
                    'CreatedTimestamp': datetime(2015, 1, 1),
                    'ModifiedTimestamp': datetime(2015, 1, 1),
                    'TimeZoneId': 'string',
                    'Locale': 'en'|'fr'|'ko'|'de'|'es'|'ja'|'ru'|'zh_CN'|'zh_TW'|'pt_BR'|'default',
                    'Storage': {
                        'StorageUtilizedInBytes': 123,
                        'StorageRule': {
                            'StorageAllocatedInBytes': 123,
                            'StorageType': 'UNLIMITED'|'QUOTA'
                        }
                    }
                },
                'CreatedTimestamp': datetime(2015, 1, 1),
                'CommentStatus': 'DRAFT'|'PUBLISHED'|'DELETED',
                'RecipientId': 'string'
            }
        },
    ],
    'Marker': 'string'
}

Response Structure

  • (dict) --

    • UserActivities (list) --

      The list of activities for the specified user and time period.

      • (dict) --

        Describes the activity information.

        • Type (string) --

          The activity type.

        • TimeStamp (datetime) --

          The timestamp when the action was performed.

        • OrganizationId (string) --

          The ID of the organization.

        • Initiator (dict) --

          The user who performed the action.

          • Id (string) --

            The ID of the user.

          • Username (string) --

            The username of the user.

          • GivenName (string) --

            The given name of the user before a rename operation.

          • Surname (string) --

            The surname of the user.

          • EmailAddress (string) --

            The email address of the user.

        • Participants (dict) --

          The list of users or groups impacted by this action. This is an optional field and is filled for the following sharing activities: DOCUMENT_SHARED, DOCUMENT_SHARED, DOCUMENT_UNSHARED, FOLDER_SHARED, FOLDER_UNSHARED.

          • Users (list) --

            The list of users.

            • (dict) --

              Describes the metadata of the user.

              • Id (string) --

                The ID of the user.

              • Username (string) --

                The username of the user.

              • GivenName (string) --

                The given name of the user before a rename operation.

              • Surname (string) --

                The surname of the user.

              • EmailAddress (string) --

                The email address of the user.

          • Groups (list) --

            The list of user groups.

            • (dict) --

              Describes the metadata of a user group.

              • Id (string) --

                The ID of the user group.

              • Name (string) --

                The name of the group.

        • ResourceMetadata (dict) --

          The metadata of the resource involved in the user action.

          • Type (string) --

            The type of resource.

          • Name (string) --

            The name of the resource.

          • OriginalName (string) --

            The original name of the resource prior to a rename operation.

          • Id (string) --

            The ID of the resource.

          • VersionId (string) --

            The version ID of the resource. This is an optional field and is filled for action on document version.

          • Owner (dict) --

            The owner of the resource.

            • Id (string) --

              The ID of the user.

            • Username (string) --

              The username of the user.

            • GivenName (string) --

              The given name of the user before a rename operation.

            • Surname (string) --

              The surname of the user.

            • EmailAddress (string) --

              The email address of the user.

          • ParentId (string) --

            The parent ID of the resource before a rename operation.

        • OriginalParent (dict) --

          The original parent of the resource. This is an optional field and is filled for move activities.

          • Type (string) --

            The type of resource.

          • Name (string) --

            The name of the resource.

          • OriginalName (string) --

            The original name of the resource prior to a rename operation.

          • Id (string) --

            The ID of the resource.

          • VersionId (string) --

            The version ID of the resource. This is an optional field and is filled for action on document version.

          • Owner (dict) --

            The owner of the resource.

            • Id (string) --

              The ID of the user.

            • Username (string) --

              The username of the user.

            • GivenName (string) --

              The given name of the user before a rename operation.

            • Surname (string) --

              The surname of the user.

            • EmailAddress (string) --

              The email address of the user.

          • ParentId (string) --

            The parent ID of the resource before a rename operation.

        • CommentMetadata (dict) --

          Metadata of the commenting activity. This is an optional field and is filled for commenting activities.

          • CommentId (string) --

            The ID of the comment.

          • Contributor (dict) --

            The user who made the comment.

            • 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.

            • Type (string) --

              The type of user.

            • CreatedTimestamp (datetime) --

              The time when the user was created.

            • ModifiedTimestamp (datetime) --

              The time when the user was modified.

            • TimeZoneId (string) --

              The time zone ID of the user.

            • Locale (string) --

              The locale of the user.

            • Storage (dict) --

              The storage for the user.

              • StorageUtilizedInBytes (integer) --

                The amount of storage utilized, in bytes.

              • StorageRule (dict) --

                The storage for a user.

                • StorageAllocatedInBytes (integer) --

                  The amount of storage allocated, in bytes.

                • StorageType (string) --

                  The type of storage.

          • CreatedTimestamp (datetime) --

          • CommentStatus (string) --

          • RecipientId (string) --

            The ID of the user being replied to.

    • Marker (string) --

      The marker for the next set of results.