Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Dropbox Community is looking for feedback from you! Sign up to be a part of our customer panel here.

Discuss Dropbox Developer & API

Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropbox Chooser response linktype for folders

Dropbox Chooser response linktype for folders

Helpful | Level 5

I am trying to get the path of the folder selected. This is how my response object looks like:

    linkType: "direct",  
    multiselect: false,  
    extensions: [],
    folderselect: true,  
    sizeLimit: 1024,

Now when I get a response path looks like

I need to get the path like "home/test" so I can save it using.


curl -X POST \
    --header "Authorization: Bearer " \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"/Homework/math\",\"recursive\": false,\"include_media_info\": false,\"include_deleted\": false,\"include_has_explicit_shared_members\": false,\"include_mounted_folders\": true,\"include_non_downloadable_files\": true}"
    "path": "/Homework/math",
    "recursive": false,
    "include_media_info": false,
    "include_deleted": false,
    "include_has_explicit_shared_members": false,
   "include_mounted_folders": true,
    "include_non_downloadable_files": true

Any Idea how I can get the path(for folder location) from the Chooser?

3 Replies 3

Dropbox Staff

The Dropbox Chooser doesn't return the path like this, but it does return the "id". You can use the id value in the "path" parameter of /2/files/list_folder.

If you do want the path for some reason though, you can call /2/sharing/get_shared_link_metadata first with the "link" value returned by the Chooser as the "url" parameter.

Either way, note this will only work if you are using an access token for the same account as the one that was logged in to the Chooser.

Helpful | Level 5

Hi Greg,

Thank you for the reply.

/2/sharing/get_shared_link_metadata does work for the shared folders.

Now we have a problem with not shared ones. For not shared ones, we get name of the folder back but not the whole path. name is valid but pathlower is null. Can we get a metadata for not shared folders? We tried below 2, but it did not work.

Above to gives access error. As I type this question, I noticed it might me because of "sharing", so I tried /http/documentation#files-get_metadata .

Oddly though, this gives back error for selected file/folder


Any thoughts?

Dropbox Staff

When you use the Chooser with the linkType: "preview" option, you'll always get back a shared link back in the "link" field, which can be used with /2/sharing/get_shared_link_metadata, whether or not the folder was previously shared. 

Note that this doesn't work with the linkType: "direct" option, since that doesn't result in actual shared links. I notice that the options you indicated originally do have linkType: "direct", but I expect that was just a typo, since it's not possible to use the linkType: "preview" option with the folderselect: true option anyway.

Anyway, the /2/sharing/get_folder_metadata and /2/sharing/get_file_metadata endpoints are meant for different kinds of sharing (shared folders and shared files, respectively, not shared links), so they won't work with the shared links returned by the Chooser.

The /2/sharing/get_shared_link_metadata endpoint will only return the path_lower value if you are using an access token for the same account as the one that was used to select the folder in the Chooser. It sounds like that wasn't the case in some of your attempts, so the field wasn't populated.

Likewise, if you specify the file path or ID for a file from a different account when calling /2/files/get_metadata, it won't be found.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    namiqismayil Helpful | Level 5
What do Dropbox user levels mean?
Need more support?