We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

TedDC's avatar
TedDC
Explorer | Level 3
2 years ago

shared_link_access_denied error with get_shared_link_file and new "/scl" link with file password

Hi,

 

I'm trying to download a file protected by password using get_shared_link_file with the new formatted "/scl" shared links but this still results in a shared_link_access_denied response.

 

Link, password and bearer are good and same query works fine for month with old "/s" format.

7 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:

    • the access type (full Dropbox or app folder) of the app registration you're using
    • the name and version number of the Dropbox SDK/library you are using, if any
    • the steps to reproduce the issue, including relevant code snippet(s) and parameter value(s), but don't include any access or refresh token(s)
    • the full text of any error or unexpected output

    If you'd prefer to share privately, please open an API ticket here. Thanks!

  • TedDC's avatar
    TedDC
    Explorer | Level 3
    2 years ago

    Hi Greg,

     

    It's an app folder access type and I'm using the Dropbox API v2 for HTTP Developers (https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file).

     

    This is the relative path to the file (it's just a zipped text file with no extension) :

    Dropbox/AppName/Records/59

     

    Shared link created with create_shared_link_with_settings and password "ABC59". I also tried to create this link with the context menu, the same share link is generated.

     

    Sample query (works fine for other files, like "/58", but with legacy formatting):

    Authorization: Bearer <access token>

    Content-Type: text/plain; charset=utf-8

    Dropbox-API-Arg: {"url": "https://www.dropbox.com/scl/fi/<specific_link>&dl=1","link_password": "ABC59"}

     

    Response :

    HTTP 401 Unauthorized

     

    Content-Type: application/json

    Content-Security-Policy: sandbox allow-forms allow-scripts

    Server: envoy

    Accept-Encoding: identity,gzip

    Cache-Control: no-cache

    Date: Fri, 21 Jul 2023 18:13:03 GMT

    X-Robots-Tag: noindex, nofollow, noimageindex

    Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

    Content-Length: 87

    X-Dropbox-Response-Origin: far_remote

    X-Dropbox-Request-Id: 594fb26ba13341a1bfc614ffd9b1998a

    X-Content-Type-Options: nosniff

    Www-Authenticate: Bearer realm="Dropbox-API"

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    Thanks! Can you double check this sample is for a 'shared_link_access_denied' error though? This sample has a 401 status code, but errors like 'shared_link_access_denied' would be expected to have a 409 status code. A 401 indicates an authorization issue, like an invalid or expired access token, for example. In any case, you should check the response body for the error message to see the cause.

  • TedDC's avatar
    TedDC
    Explorer | Level 3
    2 years ago

    Sorry, I got the header wrong in my previous post because I tried multiple solutions. Here is the good one :

     

    HTTP 409 Conflict

     

    Content-Type: application/json

    Content-Security-Policy: sandbox allow-forms allow-scripts

    Server: envoy

    Accept-Encoding: identity,gzip

    Cache-Control: no-cache

    Date: Fri, 21 Jul 2023 18:51:52 GMT

    X-Robots-Tag: noindex, nofollow, noimageindex

    Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

    Content-Length: 98

    X-Dropbox-Response-Origin: far_remote

    X-Dropbox-Request-Id: 4cbdabcd9ff14e8ca6675a62d6023936

    X-Content-Type-Options: nosniff

     

    Body :

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    Thanks, that's helpful. Please try again but using an access token for an app with the "full Dropbox" access type instead of "app folder". There's currently a bug that can cause this error on this endpoint when calling with an access token for an app folder app. 

  • TedDC's avatar
    TedDC
    Explorer | Level 3
    2 years ago

    Thanks Greg, it seems to work that way.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    Update: the /2/sharing/get_shared_link_metadata and /2/sharing/get_shared_link_file endpoints (and corresponding methods in the SDKs) should now work when using an access token for an app with the app folder access type.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers814 PostsLatest Activity: 11 hours ago
274 Following

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 or Facebook.

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!