We are creating application to help users find their files/folder in dropbox.
For searching we used dropbox API route: https://api.dropboxapi.com/2/files/search_v2
The goal is: based on results generate proper dropbox.com urls to let user visit dropbox site with opened file.
The issue is: results do not have namespaces in their lower_path or display_path, which leads to not-existing file locations.
Javascript Code (using Axios):
const response = await userClient.post(
'/2/files/search_v2',
{
query,
options: { max_results: limit },
match_field_options: { include_highlights: true }
},
{
headers: {
'Content-Type': 'application/json'
}
}
);
const results = response.data.matches;
Correct behavior:
user is logged in our system via oauth2. User account is simple Dropbox account, and there is basic get started file, its path from API will be
"path_display": "/Get Started with Dropbox.pdf"
It's okay to generate this link: https://www.dropbox.com/home?preview=Get+Started+with+Dropbox.pdf
Incorrect behavior:
User has Dropbox Business account.
With Dropbox Business, each user has it's own namespace
And the basic Dropbox Business file "Get Started with Dropbox.pdf" url will look something like this
https://www.dropbox.com/home/Username?preview=Get+Started+with+Dropbox.pdf
But from the API search request, it's path will be the same
"path_display": "/Get Started with Dropbox.pdf"
And i see no namespace_id returned in my search query.
So, the question is: how to search dropbox files/folders and properly determine, to which namespace they belong?
Thanks in advance.