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.
Greg-DB
Dropbox Community Moderator
2 years agosqudan Thanks for the information. In order to avoid that error from that method currently, you'd need to use an app registered for the "full Dropbox" access type instead of "app folder".
Alternatively, you can download the entire contents of the shared link by programmatically accessing the shared links directly and setting a relevant URL parameter as noted here, without using the API/SDK. (That is, you would use an HTTPS client of your choice instead of your dropboxClient object.) That would download the whole linked folder as a zip though, so you'd then need to programmatically unzip that and access the desired file from the result.
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!