Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
mittinga
1 year agoExplorer | Level 4
Rename a file via API from shared link
Hello everyone, I’m currently working with the Dropbox API, and I’m trying to rename a file within a shared folder. The folder is shared with me via a shared link, and I have the necessary edit p...
- 1 year ago
mittinga The path_lower field will not always be returned; please refer to the documentation for information on when any particular field will be returned. (Be sure to click on FileLinkMetadata and/or FolderLinkMetadata under the "Returns" section to expand the information for those types.)
Note also though that if you are connected to the correct account, for the item to be found in the account and the path to be returned, the call will need to be using a relevant root containing the item. So for instance, if the item is in the team space, you'll need to set the "Dropbox-API-Path-Root" header to set the root to the team space. Refer to the Team Files Guide for information on how to do so.
Greg-DB
Dropbox Community Moderator
1 year agomittinga You can get the metadata for a file/folder based on its shared link using /2/sharing/get_shared_link_metadata. Refer to the "path_lower" field documentation for information on if/when the path will be returned.
The /2/files/move_v2 endpoint does support file IDs though; you can supply a file ID in the "from_path" parameter.
mittinga
1 year agoExplorer | Level 4
Hi,
thank you for the reply.
when I call "get_shared_link_metadata" I am not getting path. only name. can't rename with name.
maybe this will help:
"visibility_policies": [
{
"policy": {
".tag": "public"
},
"resolved_policy": {
".tag": "shared_folder_only"
},
"allowed": false,
"disallowed_reason": {
".tag": "restricted_by_shared_folder"
}
},
- Greg-DB1 year ago
Dropbox Community Moderator
mittinga The path_lower field will not always be returned; please refer to the documentation for information on when any particular field will be returned. (Be sure to click on FileLinkMetadata and/or FolderLinkMetadata under the "Returns" section to expand the information for those types.)
Note also though that if you are connected to the correct account, for the item to be found in the account and the path to be returned, the call will need to be using a relevant root containing the item. So for instance, if the item is in the team space, you'll need to set the "Dropbox-API-Path-Root" header to set the root to the team space. Refer to the Team Files Guide for information on how to do so.
- mittinga1 year agoExplorer | Level 4
YES! this Dropbox-API-Path-Root header! that's what I was missing 🙂
thanks a lot!
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!