I'm having an issue downloading content from a team admins account (I'm using a dropbox buisness API with team member file access). There are several shared folders that this team admin is an owner of. However, when I run the below code I see an entry for each target item in the folder but they all have the same ID. I've only provided the code for list_folder and list_folder/continue because I'm not seeing the files to download from those functions. Some of the target folders are shared with members outside of the team but this doesn't seem to matter for some of the folders in the account because I can download those. Any help would be greatly appreciated.
Edit*: I believe that this has something to do with my listUserFolderContinue() function as if I specify the folder explicitly I am able to download the folder. I don't think I'm returning all of the results, can anyone help out on where I went wrong?
import requests
# Dropbox Business API with Team member file access)
token = 'My Key'
def listUserFolder(dbmid):
global allFiles
headers = {
'Authorization': 'Bearer {}'.format(token),
'Content-Type': 'application/json',
'Dropbox-API-Select-User': dbmid
}
data = '{"path": "","recursive": true,"include_media_info": false,"include_deleted": false,"include_has_explicit_shared_members": false,"include_mounted_folders": true}'
response = requests.post('https://api.dropboxapi.com/2/files/list_folder', headers=headers, data=data)
json = response.json()
allFiles += json['entries']
return json
def listUserFolderContinue(dbmid):
global allFiles
json = listUserFolder(dbmid)
while json['has_more']:
cursorline = json['cursor']
cursor = '{"cursor": "' + cursorline + '"}'
data = '{}'.format(cursor)
headers = {
'Authorization': 'Bearer {}'.format(token),
'Content-Type': 'application/json',
'Dropbox-API-Select-User': dbmid
}
response = requests.post('https://api.dropboxapi.com/2/files/list_folder/continue', headers=headers, data=data)
json = response.json()
allFiles += json['entries']
return allFiles