I'm attemping to enumerate all shared links within a business dropbox account as part of an audit. The most effective method I've found so far is using the dropbox.DropboxTeam.as_user().sharing_list_shared_links method to enumerate all links created by a given user. Unfortunately this returns an AuthError('invalid_select_user', None) when attempting to run on deleted accounts. Is there a way to run sharing_list_shared_links with admin credentials and see ALL accounts shared links, or a way to resolve this AuthError? App is scoped using Team Member File Access and works great for users that haven't been deleted, but this does not show links that have been created by accounts that are now deleted. Relevant code below:
def find_shared_links(dbxTeam: dropbox.DropboxTeam):
all_links = []
members = dbxTeam.team_members_list(include_removed=True)
for member in members.members:
print(member)
try:
member_links = dbxTeam.as_user(member.profile.team_member_id).sharing_list_shared_links(None)
except AuthError as e:
print(e, 'ERROR OCCURS ON DELETED ACCOUNTS HERE')
all_links.append(member_links)
return all_links