cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to make sure we keep you updated on the ideas that other users have shared here on the Community? Us too! Check them out over here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Comments

Re: Get Url to Folder by ID

Get Url to Folder by ID

LarsD
New member | Level 2

Hello,

 

so we have a list with the ids for folders in the format "id:XXXXXX".

Now I need a URL to share/open for that id.

I tried https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata but I only get the "parent_shared_folder_id".

Does anybody have a idea how that can work?

1 Accepted Solution

Accepted Solutions

Re: Get Url to Folder by ID

Greg-DB
Dropboxer

Dropbox unfortunately does not offer a way to directly get a link to a folder from an ID like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

 

There are some things that may work depending on the scenario though:

 

  • If the folder itself happens to be a shared folder, or you are able to make it a shared folder (e.g., using /2/sharing/share_folder), you could then call /2/files/get_metadata with the 'path' set to the ID of the folder to get the 'sharing_info.shared_folder_id' which is the shared folder ID, and then call /2/sharing/get_folder_metadata with that 'shared_folder_id' to get the 'preview_url'.
  • You could call /2/sharing/create_shared_link_with_settings with the 'path' set to the ID of the folder, and 'settings.audience' set to 'no_one' to get a link that would refer to the folder on the web site for anyone who has access to it, though not directly enable any additional access to it.

View solution in original post

3 Replies 3

Re: Get Url to Folder by ID

Здравко
Super Collaborator | Level 20

@LarsD wrote:

...

Now I need a URL to share/open for that id.

...


Hi @LarsD,

Do you mean a shared link? 🤔 If so, you can create such link using /2/sharing/create_shared_link_with_settings API call. 😉 Just put id as path there. If link already exists for particular id, shared_link_already_exists error will get back containing the existing URL. If you know your links exist for all ids already, you can list_shared_links.

Hope this helps.

Re: Get Url to Folder by ID

LarsD
New member | Level 2

Hi @Здравко,

 

not exactly sharing.

We have a CRM where we have customers. For each customer we have a folder in a team folder in the dropbox. And for each customer we selected the id: with the widget.

Now we want a link form our CRM to the dropbox page of these folders.

I kinda want the preview link from that:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_folder_metadata

But I don't have the right shared_folder_id.

 

Re: Get Url to Folder by ID

Greg-DB
Dropboxer

Dropbox unfortunately does not offer a way to directly get a link to a folder from an ID like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

 

There are some things that may work depending on the scenario though:

 

  • If the folder itself happens to be a shared folder, or you are able to make it a shared folder (e.g., using /2/sharing/share_folder), you could then call /2/files/get_metadata with the 'path' set to the ID of the folder to get the 'sharing_info.shared_folder_id' which is the shared folder ID, and then call /2/sharing/get_folder_metadata with that 'shared_folder_id' to get the 'preview_url'.
  • You could call /2/sharing/create_shared_link_with_settings with the 'path' set to the ID of the folder, and 'settings.audience' set to 'no_one' to get a link that would refer to the folder on the web site for anyone who has access to it, though not directly enable any additional access to it.
Need more support?