Learn how to make the most out of the Dropbox Community here 💙!
Forum Discussion
qpy
3 years agoNew member | Level 2
using api to access file/folders in Backups
Using python dropbox.Dropbox (dbx instance), and after connecting using oauth2 generated token;
am unable to access, so far, the Backups tree. Using the relative-path from "rootdir", cant seem
to...
Greg-DB
Dropbox Staff
3 years agoTo access content in your Dropbox, such as your backup data, you'll need to specify the path relative to the root. Do not add additional components not seen when browsing your Dropbox, such as "backups". The folder for backed up data is the name of the backup. For instance, if I have a backup named "Mac", containing a backed up "Desktop" folder, I would list that Desktop backup with the path "/Mac/Desktop".
You can also start with a path of the empty string "" to list the root itself.
- hello_box113 years agoExplorer | Level 4Depending on the backup type, it might because the backup is under its own namespace instead of root namespace. What you can do is to list all the namespace and concatenation the ns with the path.
- qpy3 years agoNew member | Level 2yes.. ns based path sounds right; the “root” relative path has been dead end.
Example for ns based arg?
And. how to discover what ns should be?- Greg-DB3 years ago
Dropbox Staff
qpy Can you clarify what you mean when you say 'the “root” relative path has been dead end'? I tried it and it did work for me, e.g.:
curl -X POST https://api.dropboxapi.com/2/files/list_folder \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{"path":"/Mac","recursive":true}' # { # "entries": [ # { # ".tag": "folder", # "name": "Mac", # "path_lower": "/mac", # "path_display": "/Mac", # "id": "id:Hcd4PILNenwAAAAAAAAB4w" # }, # { # ".tag": "folder", # "name": "Desktop", # "path_lower": "/mac/desktop", # "path_display": "/Mac/Desktop", # "id": "id:Hcd4PILNenwAAAAAAAAB5A" # }, # { # ".tag": "folder", # "name": "test", # "path_lower": "/mac/desktop/test", # "path_display": "/Mac/Desktop/test", # "id": "id:Hcd4PILNenwAAAAAAAAB9g" # }, # { # ".tag": "file", # "name": ".localized", # "path_lower": "/mac/desktop/.localized", # "path_display": "/Mac/Desktop/.localized", # "id": "id:Hcd4PILNenwAAAAAAAAB5w", # "client_modified": "2022-11-24T15:50:01Z", # "server_modified": "2022-11-24T15:52:31Z", # "rev": "5ee39649961e204f84cfe", # "size": 0, # "is_downloadable": true, # "content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" # }, # { # ".tag": "file", # "name": "test.txt", # "path_lower": "/mac/desktop/test/test.txt", # "path_display": "/Mac/Desktop/test/test.txt", # "id": "id:Hcd4PILNenwAAAAAAAAB9w", # "client_modified": "2022-11-24T15:44:23Z", # "server_modified": "2022-11-24T15:52:37Z", # "rev": "5ee3964eb20b004f84cfe", # "size": 9, # "is_downloadable": true, # "content_hash": "019fb066085bea5236e22c837c748607c95a050d8c36410da1e7a5ca24f67e16" # } # ], # "cursor": "AAGqg1NuBn6s4_wJjkxck2fGauGff7CMO_LBmSXDSVip2MiTblfHGHKO0VJJMhuKSO5J4zRgLQMAbOnl6d1SNukeivUqpxn06urom3LHaHnxlx93nAtMgHs2X76g_KZpfWyr74hYGT7j6JqIuxDWbbuFDLAPvqsWI06YA2F-oUR-EuhoaPI4jcEUa5lgmmmrc1CTNJviMx6iHG2tLe2o_rrf", # "has_more": false # } curl -X POST https://content.dropboxapi.com/2/files/download \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --header 'Dropbox-API-Arg: {"path":"/mac/desktop/test/test.txt"}' # something
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,970 PostsLatest Activity: 9 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!