Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
schmidtc63
5 months agoNew member | Level 2
Can't retrieve file count or file listing
I have no problem getting a token. With that token I can submit
/2/team/token/get_authenticated_admin and get the admin info. From there, I can submit
/2/users/get_current_account, passing the team_member_id I got from the previous api call.
One of the items passed back is:
"root_info": {
".tag"
:
"user",
"root_namespace_id"
:
"2617xxxxxx",
"home_namespace_id"
:
"1787xxxxxx",
"home_path"
:
"/Mariah"
}I have no issues with this:
curl -X POST https://api.dropboxapi.com/2/files/list_folder \
--header 'Authorization: Bearer <mytoken> \
--header 'Content-Type: application/json' \
--header 'Dropbox-Api-Select-User: dbmid:AACFxxxxxxxxxxxxxxxxxxxx' \
--data '{"path":"/kickee images","recursive":false,"include_media_info":true,"include_mounted_folders":true}'</mytoken>From that, one of the returned items is:
{
".tag": "file",
"name": "OSD78-3-K-YRC-VS-alt2-YAL.jpg",
"path_lower": "/kickee images/osd78-3-k-yrc-vs-alt2-yal.jpg",
"path_display": "/KICKEE IMAGES/OSD78-3-K-YRC-VS-alt2-YAL.jpg",
"parent_shared_folder_id": "1798xxxxx",
"id": "id:OSjWkHwnxxxxxxxxxxx",
"client_modified": "2022-06-16T15:46:52Z",
"server_modified": "2023-08-16T18:40:49Z",
"rev": "6030ea26b853d6b372fb3",
"size": 158532,
"sharing_info": {
"read_only": false,
"parent_shared_folder_id": "1798xxxxx",
"modified_by": "dbid:AABa5y4GiPxxxxxxx"
},
"is_downloadable": true,
"content_hash": "73021542c3f9b6e2adb7e7ac61f54d46ece0893a2f51766594b40f798efab548"
}However, when I try to get a file count on the root directory using the root_namespace_id:
curl -X POST https://api.dropboxapi.com/2/file_requests/count \
--header 'Authorization: Bearer <mytoken>' \
--header 'Content-Type: application/json' \
--header 'Dropbox-Api-Path-Root: {".tag":"root", "root":"2617xxxxx"}' \
--header 'Dropbox-Api-Select-User: dbmid:AACFxh5TjExxxxxxx' \
--data 'null'</mytoken>I get this: { "file_request_count": 0 }
If I use the home_namespace_id in the above call, I get this:
{ "error": { ".tag": "invalid_root", "invalid_root": { ".tag": "team", "home_namespace_id": "1787xxxxx", "home_path": "/Mariah Nagma", "root_namespace_id": "2617xxxxx" } }, "error_summary": "invalid_root/" }All I'm trying to do, eventually, is to move/rename a file. But I can't even get a file count or a file list:
{
"file_requests": [],
"cursor": "AACkg6FBSbDUskOcnoVpSIWAibkbgr2HGN39aJS3N_ssPfHfHs0vZ3E8QqO0n3UuCyEo2I0qXc7S2lPER8gUSEocbDLqw4aw84Zl8Rsr8K3dMuaSgtsm2jDQs6amotL-N69UJdqLLUipIrDg-8Ibx7sO79J6VbrkGr0DGzCaemCm8_eDJrEIX5bfbn4_7xAY9tTSklglnhB8O37vNnm424ZT",
"has_more": false
}A move requests informs me that source file doesn't exist:
{
"error_summary": "from_lookup/not_found/...",
"error": {
".tag": "from_lookup",
"from_lookup": {
".tag": "not_found"
}
}
}What am I doing wrong?
Thanks,
Chris
2 Replies
Replies have been turned off for this discussion
- schmidtc635 months agoNew member | Level 2
And nevermind! LOL! I was using the "file_requests" api which has nothing to do with this. All is working well. That's not how this works. That's not how any of this works.
- DB-Des5 months ago
Dropbox Community Moderator
Hi schmidtc63
I'm happy to hear you were able to figure this out!
If you have any further technical questions, let us know. We're here to help!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!