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: 409 Conflict when calling sharing/get_shared_link_metadata

409 Conflict when calling sharing/get_shared_link_metadata

idanarie
Explorer | Level 4

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 everything seems to work.

However, in the next call that we are making using the token we received - 
GET sharing/get_shared_link_metadata we get a conflict error message (409), even though the dropbox document was shared and can be accessed without an issue.

Is there anything that could cause this?

Would appreciate any help

8 Replies 8

Scott-DB
Dropbox Staff

Hello,

 

Does the response include any other information than the code? There is likely an error message returned which should explain what the issue is.

 

Scott

idanarie
Explorer | Level 4

Hi Scott, thanks for the reply.

I tested it locally on Postman, this is the error I am seeing (even though the link is shared and can be accessed by anyone)

 

{
    "error_summary": "shared_link_access_denied/.",
    "error": {
        ".tag": "shared_link_access_denied"
    }
}

idanarie_0-1679817012041.png

 

 

Greg-DB
Dropbox Staff

@idanarie Are you using an API app registered with the "app folder" access type? There's currently a bug that results in this error when using this method with an access token for an app folder app. That's still open with engineering, but I don't have a timeline on a fix.

squdan
New member | Level 2

Hi Greg, there is some new about this error? It's affecting my project also.

Greg-DB
Dropbox Staff

@squdan I don't have an update on this case. Are you using an app with the "app folder" access type?

squdan
New 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.

squdan_0-1710168496449.png

squdan_1-1710168553728.png

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 Staff

@squdan 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.

Здравко
Legendary | 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.

Need more support?