Need to see if your shared folder is taking up space on your dropbox đšâđ»? Find out how to check here.
Forum Discussion
prjtprgn
9 months agoNew member | Level 1
Unable to Retrieve Dropbox "path_display" for Folders in Google Sheets Script
I'm developing a Google Sheets database that feeds an interactive map on My Maps. The script uses the Dropbox API to update folder names (in column A) and folder paths (in column F) based on metadata...
- 9 months ago
Hi prjtprgn,
It looks like there are a couple of issues with your script. First, it is expected for the endpoint /sharing/get_shared_link_metadata to not return a "path_display" property.
The next issue appears to be after a request is sent to /sharing/list_folders and /sharing/list_mountable_folders, the script seems to be trying to match the "shared_folder_id" with a "folder_id" property:
const matchingFolder = listFolders.entries.find(folder => folder.shared_folder_id === json.id.replace('id:', '') );These two values are completely different. Even though a "shared_folder_id" is a string, it is usually a numeric-only value, as such "84528192421". Whereas a "folder_id" is an alphanumeric value, prepended by the word "id", as such: "id:a4ayc_80_OEAAAAAAAAAXw".
Additionally, /sharing/get_folder_metadata is expecting a "shared_folder_id" value, the script is sending it a "folder_id" value:
payload = { shared_folder_id: json.id.replace('id:', '') };As previously mentioned, these are completely different values, even for the same folder.
Lastly, the following fallback log:
Fallback Log: `3 March 2025, 15:10:42 Info Fallback API Response for https://www.dropbox.com/scl/fo/REPLACE_URL?dl=0: Error in call to API function "files/get_metadata": request body: unknown field 'shared_link'`Indicates a request was possibly sent to /files/get_metadata endpoint. This endpoint does not accept a "shared_link" as a parameter.
To get better insight into whatâs happening, Iâd recommend adding additional loggers to your script. This will help you visualize all the data being returned by the API and confirm whether youâre working with the right values.
DB-Des
Dropbox Community Moderator
9 months agoHi prjtprgn,
It looks like there are a couple of issues with your script. First, it is expected for the endpoint /sharing/get_shared_link_metadata to not return a "path_display" property.
The next issue appears to be after a request is sent to /sharing/list_folders and /sharing/list_mountable_folders, the script seems to be trying to match the "shared_folder_id" with a "folder_id" property:
const matchingFolder = listFolders.entries.find(folder =>
folder.shared_folder_id === json.id.replace('id:', '')
);
These two values are completely different. Even though a "shared_folder_id" is a string, it is usually a numeric-only value, as such "84528192421". Whereas a "folder_id" is an alphanumeric value, prepended by the word "id", as such: "id:a4ayc_80_OEAAAAAAAAAXw".
Additionally, /sharing/get_folder_metadata is expecting a "shared_folder_id" value, the script is sending it a "folder_id" value:
payload = {
shared_folder_id: json.id.replace('id:', '')
};
As previously mentioned, these are completely different values, even for the same folder.
Lastly, the following fallback log:
Fallback Log:
`3 March 2025, 15:10:42 Info Fallback API Response for
https://www.dropbox.com/scl/fo/REPLACE_URL?dl=0: Error in call to API function
"files/get_metadata": request body: unknown field 'shared_link'`
Indicates a request was possibly sent to /files/get_metadata endpoint. This endpoint does not accept a "shared_link" as a parameter.
To get better insight into whatâs happening, Iâd recommend adding additional loggers to your script. This will help you visualize all the data being returned by the API and confirm whether youâre working with the right values.
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!