class documentation

Use this class to make requests to the Dropbox API using a team's access token. Methods of this class are meant to act on the team, but there is also an :meth:`as_user` method for assuming a team member's identity.

Method as_admin Allows a team credential to assume the identity of an administrator on the team and perform operations on any team-owned content.
Method as_user Allows a team credential to assume the identity of a member of the team.
Method _get_dropbox_client_with_select_header Get Dropbox client with modified headers

Inherited from _DropboxTransport:

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ :param str oauth2_access_token: OAuth2 access token for making client requests. :param int max_retries_on_error: On 5xx errors, the number of times to retry. :param Optional[int] max_retries_on_rate_limit: On 429 errors, the number of times to retry...
Method check_and_refresh_access_token Checks if access token needs to be refreshed and refreshes if possible :return:
Method clone Creates a new copy of the Dropbox client with the same defaults unless modified by arguments to clone()
Method close Cleans up all resources like the request session/network connection.
Method raise_dropbox_error_for_resp Checks for errors from a res and handles appropiately.
Method refresh_access_token Refreshes an access token via refresh token if available
Method request Makes a request to the Dropbox API and in the process validates that the route argument and result are the expected data types. The request_arg is converted to JSON based on the arg_data_type. Likewise, the response is deserialized from JSON and converted to an object based on the {result,error}_data_type.
Method request_json_object Makes a request to the Dropbox API, taking a JSON-serializable Python object as an argument, and returning one as a response.
Method request_json_string See :meth:`request_json_string_with_retry` for description of parameters.
Method request_json_string_with_retry See :meth:`request_json_object` for description of parameters.
Method with_path_root Creates a clone of the Dropbox instance with the Dropbox-API-Path-Root header as the appropriate serialized instance of PathRoot.
Method _get_route_url Returns the URL of the route.
Method _save_body_to_file Saves the body of an HTTP response to a file.
Constant _API_VERSION Undocumented
Constant _ROUTE_STYLE_DOWNLOAD Undocumented
Constant _ROUTE_STYLE_RPC Undocumented
Constant _ROUTE_STYLE_UPLOAD Undocumented
Instance Variable _app_key Undocumented
Instance Variable _app_secret Undocumented
Instance Variable _headers Undocumented
Instance Variable _host_map Undocumented
Instance Variable _logger Undocumented
Instance Variable _max_retries_on_error Undocumented
Instance Variable _max_retries_on_rate_limit Undocumented
Instance Variable _oauth2_access_token Undocumented
Instance Variable _oauth2_access_token_expiration Undocumented
Instance Variable _oauth2_refresh_token Undocumented
Instance Variable _raw_user_agent Undocumented
Instance Variable _scope Undocumented
Instance Variable _session Undocumented
Instance Variable _timeout Undocumented
Instance Variable _user_agent Undocumented

Inherited from DropboxTeamBase (via _DropboxTransport):

Method file_properties_templates_add_for_team Add a template associated with a team. See :meth:`file_properties_properties_add` to add properties to a file or folder. Note: this endpoint will create team-owned templates.
Method file_properties_templates_get_for_team Get the schema for a specified template.
Method file_properties_templates_list_for_team Get the template identifiers for a team. To get the schema of each template use :meth:`file_properties_templates_get_for_team`.
Method file_properties_templates_remove_for_team Permanently removes the specified template created from :meth:`file_properties_templates_add_for_user`. All properties associated with the template will also be removed. This action cannot be undone.
Method file_properties_templates_update_for_team Update a template associated with a team. This route can update the template name, the template description and add optional properties to templates.
Method team_devices_list_member_devices List all device sessions of a team's member.
Method team_devices_list_members_devices List all device sessions of a team. Permission : Team member file access.
Method team_devices_list_team_devices List all device sessions of a team. Permission : Team member file access.
Method team_devices_revoke_device_session Revoke a device session of a team's member.
Method team_devices_revoke_device_session_batch Revoke a list of device sessions of team members.
Method team_features_get_values Get the values for one or more featues. This route allows you to check your account's capability for what feature you can access or what value you have for certain features. Permission : Team information.
Method team_get_info Retrieves information about a team.
Method team_groups_create Creates a new, empty group, with a requested name. Permission : Team member management.
Method team_groups_delete Deletes a group. The group is deleted immediately. However the revoking of group-owned resources may take additional time. Use the :meth:`team_groups_job_status_get` to determine whether this process has completed...
Method team_groups_get_info Retrieves information about one or more groups. Note that the optional field ``GroupFullInfo.members`` is not returned for system-managed groups. Permission : Team Information.
Method team_groups_job_status_get Once an async_job_id is returned from :meth:`team_groups_delete`, :meth:`team_groups_members_add` , or :meth:`team_groups_members_remove` use this method to poll the status of granting/revoking group members' access to group-owned resources...
Method team_groups_list Lists groups on a team. Permission : Team Information.
Method team_groups_list_continue Once a cursor has been retrieved from :meth:`team_groups_list`, use this to paginate through all groups. Permission : Team Information.
Method team_groups_members_add Adds members to a group. The members are added immediately. However the granting of group-owned resources may take additional time. Use the :meth:`team_groups_job_status_get` to determine whether this process has completed...
Method team_groups_members_list Lists members of a group. Permission : Team Information.
Method team_groups_members_list_continue Once a cursor has been retrieved from :meth:`team_groups_members_list`, use this to paginate through all members of the group. Permission : Team information.
Method team_groups_members_remove Removes members from a group. The members are removed immediately. However the revoking of group-owned resources may take additional time. Use the :meth:`team_groups_job_status_get` to determine whether this process has completed...
Method team_groups_members_set_access_type Sets a member's access type in a group. Permission : Team member management.
Method team_groups_update Updates a group's name and/or external ID. Permission : Team member management.
Method team_legal_holds_create_policy Creates new legal hold policy. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_legal_holds_get_policy Gets a legal hold by Id. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_legal_holds_list_held_revisions List the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_legal_holds_list_held_revisions_continue Continue listing the file metadata that's under the hold. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_legal_holds_list_policies Lists legal holds on a team. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_legal_holds_release_policy Releases a legal hold by Id. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_legal_holds_update_policy Updates a legal hold. Note: Legal Holds is a paid add-on. Not all teams have the feature. Permission : Team member file access.
Method team_linked_apps_list_member_linked_apps List all linked applications of the team member. Note, this endpoint does not list any team-linked applications.
Method team_linked_apps_list_members_linked_apps List all applications linked to the team members' accounts. Note, this endpoint does not list any team-linked applications.
Method team_linked_apps_list_team_linked_apps List all applications linked to the team members' accounts. Note, this endpoint doesn't list any team-linked applications.
Method team_linked_apps_revoke_linked_app Revoke a linked application of the team member.
Method team_linked_apps_revoke_linked_app_batch Revoke a list of linked applications of the team members.
Method team_log_get_events Retrieves team events. If the result's ``GetTeamEventsResult.has_more`` field is ``True``, call :meth:`team_log_get_events_continue` with the returned cursor to retrieve more entries. If end_time is not specified in your request, you may use the returned cursor to poll :meth:`team_log_get_events_continue` for new events...
Method team_log_get_events_continue Once a cursor has been retrieved from :meth:`team_log_get_events`, use this to paginate through all events. Permission : Team Auditing.
Method team_member_space_limits_excluded_users_add Add users to member space limits excluded users list.
Method team_member_space_limits_excluded_users_list List member space limits excluded users.
Method team_member_space_limits_excluded_users_list_continue Continue listing member space limits excluded users.
Method team_member_space_limits_excluded_users_remove Remove users from member space limits excluded users list.
Method team_member_space_limits_get_custom_quota Get users custom quota. Returns none as the custom quota if none was set. A maximum of 1000 members can be specified in a single call.
Method team_member_space_limits_remove_custom_quota Remove users custom quota. A maximum of 1000 members can be specified in a single call.
Method team_member_space_limits_set_custom_quota Set users custom quota. Custom quota has to be at least 15GB. A maximum of 1000 members can be specified in a single call.
Method team_members_add Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created with the given email address, and that account will be invited to the team...
Method team_members_add_job_status_get Once an async_job_id is returned from :meth:`team_members_add` , use this to poll the status of the asynchronous request. Permission : Team member management.
Method team_members_add_job_status_get_v2 Once an async_job_id is returned from :meth:`team_members_add_v2` , use this to poll the status of the asynchronous request. Permission : Team member management.
Method team_members_add_v2 Adds members to a team. Permission : Team member management A maximum of 20 members can be specified in a single call. If no Dropbox account exists with the email address specified, a new Dropbox account will be created with the given email address, and that account will be invited to the team...
Method team_members_delete_profile_photo Deletes a team member's profile photo. Permission : Team member management.
Method team_members_delete_profile_photo_v2 Deletes a team member's profile photo. Permission : Team member management.
Method team_members_get_available_team_member_roles Get available TeamMemberRoles for the connected team. To be used with :meth:`team_members_set_admin_permissions_v2`. Permission : Team member management.
Method team_members_get_info Returns information about multiple team members. Permission : Team information This endpoint will return ``MembersGetInfoItem.id_not_found``, for IDs (or emails) that cannot be matched to a valid team member.
Method team_members_get_info_v2 Returns information about multiple team members. Permission : Team information This endpoint will return ``MembersGetInfoItem.id_not_found``, for IDs (or emails) that cannot be matched to a valid team member.
Method team_members_list Lists members of a team. Permission : Team information.
Method team_members_list_continue Once a cursor has been retrieved from :meth:`team_members_list`, use this to paginate through all team members. Permission : Team information.
Method team_members_list_continue_v2 Once a cursor has been retrieved from :meth:`team_members_list_v2`, use this to paginate through all team members. Permission : Team information.
Method team_members_list_v2 Lists members of a team. Permission : Team information.
Method team_members_move_former_member_files Moves removed member's files to a different member. This endpoint initiates an asynchronous job. To obtain the final result of the job, the client should periodically poll :meth:`team_members_move_former_member_files_job_status_check`...
Method team_members_move_former_member_files_job_status_check Once an async_job_id is returned from :meth:`team_members_move_former_member_files` , use this to poll the status of the asynchronous request. Permission : Team member management.
Method team_members_recover Recover a deleted member. Permission : Team member management Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
Method team_members_remove Removes a member from a team. Permission : Team member management Exactly one of team_member_id, email, or external_id must be provided to identify the user account. Accounts can be recovered via :meth:`team_members_recover` for a 7 day period or until the account has been permanently deleted or transferred to another account (whichever comes first)...
Method team_members_remove_job_status_get Once an async_job_id is returned from :meth:`team_members_remove` , use this to poll the status of the asynchronous request. Permission : Team member management.
Method team_members_secondary_emails_add Add secondary emails to users. Permission : Team member management. Emails that are on verified domains will be verified automatically. For each email address not on a verified domain a verification email will be sent.
Method team_members_secondary_emails_delete Delete secondary emails from users Permission : Team member management. Users will be notified of deletions of verified secondary emails at both the secondary email and their primary email.
Method team_members_secondary_emails_resend_verification_emails Resend secondary email verification emails. Permission : Team member management.
Method team_members_send_welcome_email Sends welcome email to pending team member. Permission : Team member management Exactly one of team_member_id, email, or external_id must be provided to identify the user account. No-op if team member is not pending.
Method team_members_set_admin_permissions Updates a team member's permissions. Permission : Team member management.
Method team_members_set_admin_permissions_v2 Updates a team member's permissions. Permission : Team member management.
Method team_members_set_profile Updates a team member's profile. Permission : Team member management.
Method team_members_set_profile_photo Updates a team member's profile photo. Permission : Team member management.
Method team_members_set_profile_photo_v2 Updates a team member's profile photo. Permission : Team member management.
Method team_members_set_profile_v2 Updates a team member's profile. Permission : Team member management.
Method team_members_suspend Suspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
Method team_members_unsuspend Unsuspend a member from a team. Permission : Team member management Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
Method team_namespaces_list Returns a list of all team-accessible namespaces. This list includes team folders, shared folders containing team members, team members' home namespaces, and team members' app folders. Home namespaces and app folders are always owned by this team or members of the team, but shared folders may be owned by other users or other teams...
Method team_namespaces_list_continue Once a cursor has been retrieved from :meth:`team_namespaces_list`, use this to paginate through all team-accessible namespaces. Duplicates may occur in the list.
Method team_properties_template_add Permission : Team member file access.
Method team_properties_template_get Permission : Team member file access. The scope for the route is files.team_metadata.write.
Method team_properties_template_list Permission : Team member file access. The scope for the route is files.team_metadata.write.
Method team_properties_template_update Permission : Team member file access.
Method team_reports_get_activity Retrieves reporting data about a team's user activity. Deprecated: Will be removed on July 1st 2021.
Method team_reports_get_devices Retrieves reporting data about a team's linked devices. Deprecated: Will be removed on July 1st 2021.
Method team_reports_get_membership Retrieves reporting data about a team's membership. Deprecated: Will be removed on July 1st 2021.
Method team_reports_get_storage Retrieves reporting data about a team's storage usage. Deprecated: Will be removed on July 1st 2021.
Method team_sharing_allowlist_add Endpoint adds Approve List entries. Changes are effective immediately. Changes are committed in transaction. In case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails (RFC-5322/822) are accepted...
Method team_sharing_allowlist_list Lists Approve List entries for given team, from newest to oldest, returning up to `limit` entries at a time. If there are more than `limit` entries associated with the current team, more can be fetched by passing the returned `cursor` to :meth:`team_sharing_allowlist_list_continue`.
Method team_sharing_allowlist_list_continue Lists entries associated with given team, starting from a the cursor. See :meth:`team_sharing_allowlist_list`.
Method team_sharing_allowlist_remove Endpoint removes Approve List entries. Changes are effective immediately. Changes are committed in transaction. In case of single validation error - all entries are rejected. Valid domains (RFC-1034/5) and emails (RFC-5322/822) are accepted...
Method team_team_folder_activate Sets an archived team folder's status to active. Permission : Team member file access.
Method team_team_folder_archive Sets an active team folder's status to archived and removes all folder and file members. This endpoint cannot be used for teams that have a shared team space. Permission : Team member file access.
Method team_team_folder_archive_check Returns the status of an asynchronous job for archiving a team folder. Permission : Team member file access.
Method team_team_folder_create Creates a new, active, team folder with no members. This endpoint can only be used for teams that do not already have a shared team space. Permission : Team member file access.
Method team_team_folder_get_info Retrieves metadata for team folders. Permission : Team member file access.
Method team_team_folder_list Lists all team folders. Permission : Team member file access.
Method team_team_folder_list_continue Once a cursor has been retrieved from :meth:`team_team_folder_list`, use this to paginate through all team folders. Permission : Team member file access.
Method team_team_folder_permanently_delete Permanently deletes an archived team folder. This endpoint cannot be used for teams that have a shared team space. Permission : Team member file access.
Method team_team_folder_rename Changes an active team folder's name. Permission : Team member file access.
Method team_team_folder_update_sync_settings Updates the sync settings on a team folder or its contents. Use of this endpoint requires that the team has team selective sync enabled.
Method team_token_get_authenticated_admin Returns the member profile of the admin who generated the team access token used to make the call.
def as_admin(self, team_member_id): (source)

Allows a team credential to assume the identity of an administrator on the team and perform operations on any team-owned content. :param str team_member_id: team member id of administrator to perform actions with :return: A :class:`Dropbox` object that can be used to query on behalf of this admin of the team. :rtype: Dropbox

def as_user(self, team_member_id): (source)

Allows a team credential to assume the identity of a member of the team. :param str team_member_id: team member id of team member to perform actions with :return: A :class:`Dropbox` object that can be used to query on behalf of this member of the team. :rtype: Dropbox

def _get_dropbox_client_with_select_header(self, select_header_name, team_member_id): (source)

Get Dropbox client with modified headers :param str select_header_name: Header name used to select users :param str team_member_id: team member id of team member to perform actions with :return: A :class:`Dropbox` object that can be used to query on behalf of a member or admin of the team :rtype: Dropbox