We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
idanarie
3 years agoExplorer | Level 4
409 Conflict when calling sharing/get_shared_link_metadata
Hi team, we have an OAuth 2 integration with Dropbox (switched from access token integration to OAuth2). After the authentication, we are sending an API call check/user we get 200 message and ever...
squdan
2 years agoNew member | Level 2
Yes, I'll give you all information about my case, maybe there is another way to achieve what I need.
I'm developing a new APP that stores some information into app users dropbox account, this works fine. Also, this app needs to access to a shared folder from my dropbox account to read some files, but I'm getting "SHARED_LINK_ACCESS_ERROR" error when I try to read from app.
Scoped app (App folder) is automatically set with selected permissions.
I'm using Java SDK 2.
public String getPublicFileContent(final String sharedUrl, final String folder, final String filename) {
String result;
try (final DbxDownloader<SharedLinkMetadata> dropboxSharedLinkFileDownloader = dropboxClient
.sharing()
.getSharedLinkFileBuilder(sharedUrl)
.withPath(getPath(folder, filename))
.start()) {
// Obtain input stream from file
final InputStream fileInputStream = dropboxSharedLinkFileDownloader.getInputStream();
// Read input stream
result = new String(fileInputStream.readAllBytes(), StandardCharsets.UTF_8);
} catch (final DbxException e) {
log.error("[DROPBOX] Error al accssing public file '{}' - '{}' - '{}'. Error: ", sharedUrl, folder, filename, e);
} catch (final IOException e) {
log.error("[DROPBOX] Error reading public file '{}' - '{}' - '{}'. Error: ", sharedUrl, folder, filename, e);
}
return result.toString();
}Error:
{
"cause" : null,
"stackTrace" : [ {
"classLoaderName" : null,
"moduleName" : "java.desktop",
"moduleVersion" : "17.0.6",
"methodName" : "run",
"fileName" : "EventDispatchThread.java",
"lineNumber" : 90,
"nativeMethod" : false,
"className" : "java.awt.EventDispatchThread"
} ],
"requestId" : "5bc7ef1fdb6d4731a41186a86e390b3f",
"userMessage" : null,
"errorValue" : "SHARED_LINK_ACCESS_DENIED",
"message" : "Exception in 2/sharing/get_shared_link_file: SHARED_LINK_ACCESS_DENIED",
"suppressed" : [ ],
"localizedMessage" : "Exception in 2/sharing/get_shared_link_file: SHARED_LINK_ACCESS_DENIED"
}If there is some error in my configuration or how I try to access to the file, pls tell me.
Здравко
2 years agoLegendary | Level 20
squdan wrote:Yes, I'll give you all information about my case, maybe there is another way to achieve what I need.
...
Hi squdan,
Yes, As Greg said, there is a bug in current supported set of such API calls. Fortunately, there is undocumented set of API calls too. You can use some of them to achieve what you need. Take a look here for a possible way to list link to folder. 😉 Once you have all entries links, you can download them using any regular download method, as Greg described already. You can get a rough idea how download can be performed here (just translate relevant parts to Java).
Good luck.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!