cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: Path to files and folders in a Team Folder

Path to files and folders in a Team Folder

alreeves27
Explorer | Level 3

I am using the API v2 endpoints to query a user's dropbox account for their folder structure to allow the user to select a folder.   We are offering a service to be able to import files dropped in that folder into our document managment system.

 

Everything works with folders and files in the user's account however I'm stuck with the interface to Team Folders when a Dropbox for Business account is used.  I am still using the user end points and not the business end points.  I can get the list of team shares but when I query the contents of the shares using list_folders endpoint, the files and subfolders metadata all have an empty path lower.  So I am not sure how I then proceed to retrieve the contents of the subfolder or even retrieve the file as I don't know what path/url to use.   I can't even get/create a shareable link without a path/url.

 

I'm not sure what I am missing here and hope someone can get me over the hump.   

 

I am using the .Net API if that matters.

 

10 Replies 10

Greg-DB
Dropbox Staff

If the PathLower is missing, that should indicate that the folder isn't "mounted" in that user's account. (E.g., they have access to it, but haven't added it to their account.)

 

Are you sure you're looking at the entry for the actual team folder you're looking for? Some accounts may have old/unmounted shared/team folders. Make sure you use both SharingUserRoutes.ListFoldersAsync and SharingUserRoutes.ListFoldersContinueAsync to page through the results if necessary to get everything.

 

You can also use FilesUserRoutes.ListFolderAsync and FilesUserRoutes.ListFolderContinueAsync to get the actual file/folder listing.

alreeves27
Explorer | Level 3

Greg,

Thank  you for the quick reply.

 

I'm not sure how to mount a team Folder to my account. 

 

Here is my list of team folders in the Admin Console:

TeamFolders.JPG

My account has the folders listed.  Are they still not mounted?

Files.JPG

 

I am using the ListFoldersAsync and can get the Share and it's URL:

GetShare.JPG

 

The problem is I am then using Files.ListFolderAsync (using the previewUrl value) to get the contents of the shared folder and I don't see anything in the metadata for the subfolder that I can use to reference that folder (url or path) to then call ListFolderAsync on the subfolder to get its contents.   I tried passing in the "id:" value as the path as documentation for list_folder appears to allow that also (path String(pattern="(/(.|[\r\n])*)?|id:.*|(ns:[0-9]+(/.*)?)") A unique identifier for the file. )   But I get error path not found. 

 

 

GetContentsofShare.JPG

 

 

 

alreeves27
Explorer | Level 3

I was able to get the contents of the subfolder in a share if I passed in the link to the share and the path where I set the path as "/<foldername>".      I tried passing in the id as path and along with the share url and it didn't work.

 

 

I'm going to see if I can list then subsequently retrieve the files in the subfolder with a similiar approach.    

alreeves27
Explorer | Level 3

I was able to get the listing of the shared folders by calling FileUserRoutes.ListFolders by passing in the url of the top shared folder then the path to the file or folder.  I have to keep track of the path on my side as a navigate the structure as opposed to it being provided in the pathLower field.  I know the parent folder path however so it is easy to construct.  

 

Writing it up helped me see what I hadn't tried. 

 

Now to see how to retrieve and delete a file in a Team Folder and as well as how to upload a file to a Team Folder.   

 

 

Greg-DB
Dropbox Staff
I'm glad to hear you were able to make progress on this.

For reference, you mentioned you are using the user endpoints, but are you using a "Dropbox Business API" app registration? If so, how are you constructing the API client object you're using?

Also, is your team signed up for any beta features? That can affect the behavior you see here.

alreeves27
Explorer | Level 3

I was just trying to keep it simple in referring to the end points as I can correlate that to a API call.    I am just using the .Net Dropbox API at the moment and not the Dropbox Business API.   Based on reading this ... 

 

https://www.dropboxforum.com/t5/API-support/Moving-to-Dropbox-Personal-to-Business/td-p/211727

 

All my functionality works for the user's account and I am attempting to extend it to the Team Shares the user has access to.    

 

Currently I have the url to the share then the path to the file.  I can query GetSharedLinkMetadataAsync and it will tell me no shared link to the file exists.   I can even call CreatedSharedLinkWithSettingsAsync and it will also tell me no shared link to the file exists.  Problem I am having now is that the CreateSharedLinkWithSettingsAsync only includes the path as the parameter and not the url so I don't know what to pass or how to create a shared link to the file so I can download it using the GetSharedLinkFileAsync.    

 

No we aren't sign up.  I've attepted to get information on being a technology/reseller partner but getting this working first has been my focus. 

Greg-DB
Dropbox Staff
Apologies for the bother, but I'm not sure I follow. Could you open a ticket with the relevant app and account ID here so I can check on your configuration so I can advise properly?

https://www.dropbox.com/developers/contact

Thanks in advance!

omrika
Explorer | Level 3

i am having the same problem,

and didn't understand in what URL are you using

- the shared folder have only "sharedFolderId" and "PreviewUrl".

how is it possible to go inside the hierarchy in shared folders?

 

using the file.listFolderAsync() method with those Path for example sharefolderId that called "Test" and i am trying to fetch the .Files.ListFolderAsync("/Test")

 

i am getting error

 

any suggenstions?

 

Greg-DB
Dropbox Staff

@omrika I'm not sure I follow your question. I'll be happy to help, but I'll need some more information.

Also, this is an old thread, so in order to not spam the original author here, please open a new thread with the details of the issue you're seeing:

https://www.dropboxforum.com/t5/forums/postpage/board-id/101000014

Please include a description of what you're trying to accomplish, as well as the current relevant code and the error you're getting. Thanks in advance! 

Need more support?