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: JAVA API Shared Link Access Denied

JAVA API Shared Link Access Denied

softwaremedicalshare
New member | Level 2
Go to solution

Hi,

 

Have a JAVA application that uploads files to Dropbox, suddenly having a [Exception in 2/sharing/create_shared_link_with_settings: "access_denied" ] when trying to get the shared link. This error started 1-2 days ago.

 

Upload works fine and file is visible from dropbox webpage

 

This is the code that throws the error

 

SharedLinkMetadata slmFile = client.sharing().createSharedLinkWithSettings("/dir1/file.txt",
SharedLinkSettings.newBuilder()
.withRequestedVisibility(RequestedVisibility.PUBLIC).build());

And this is the full error stack trace:

com.dropbox.core.v2.sharing.CreateSharedLinkWithSettingsErrorException: Exception in 2/sharing/create_shared_link_with_settings: "access_denied"
at com.dropbox.core.v2.sharing.DbxUserSharingRequests.createSharedLinkWithSettings(DbxUserSharingRequests.java:483)
at com.dropbox.core.v2.sharing.DbxUserSharingRequests.createSharedLinkWithSettings(DbxUserSharingRequests.java:526)

1 Accepted Solution

Accepted Solutions

softwaremedicalshare
New member | Level 2
Go to solution

I just finish a phone call with support. it was not issue with banning or permissions, it was a downloading "bandwidth" issue of the account (not a file) so I think dropbox api should  address in better way the problem issue.

 

Thanks for your help!

View solution in original post

8 Replies 8

Здравко
Legendary | Level 20
Go to solution

Hi @softwaremedicalshare,

Did you ensure "sharing.write" permission for your application (both in Application console and on token generation)?

Hope this gives right direction.

Greg-DB
Dropbox Staff
Go to solution

@softwaremedicalshare It sounds like your links may currently be banned on your account. That would cause this error. (This doesn't sound like a scopes issue; that would be a different error message.)

 

You can find more information on link bans here: https://help.dropbox.com/files-folders/share/banned-links 

softwaremedicalshare
New member | Level 2
Go to solution

Hi @Здравко, 

 

Have this options in Application "Permissions" tab

Account info

   account_info.write off

   account_info.read is on

Files and folders

   files.metadata.write is on

   files.metadata.read is on

   files.content.write is on

   files.content.read is on

Collaboration

   sharing.write is on

   sharing.read is on

   file_request.write is on

   file_request.read is on

   contacts.write is on

 

Token generation was done with

   Allow public clients (Implicit Grant & PKCE) is Allow
   Access token expiration is No expiration

 

I generate a new token yesterday thinking it could be the issue, but issue remains. I can upload files, files is perfectly stored in dropbox but cannot generate shared link within the application. Also I just test and my username cannot create a shared link. Dropbox page says: "You do not have permissions to create a link for the file" (I just translate it maybe is not the exact message in English)

 

Greg-DB
Dropbox Staff
Go to solution

@softwaremedicalshare It looks like our comments just crossed. Be sure to check out my message here.

softwaremedicalshare
New member | Level 2
Go to solution

Hi @Greg-DB, 

 

The issue you address sound more like a "banned link" i mean, something that existed before and suddenly it is banned for the reasons described in the link provided. The issue right now is that I cannot create new links for new files.

 

Thanks anyway

Здравко
Legendary | Level 20
Go to solution

Hi @softwaremedicalshare,

Just for clarity: When I mentioned "and on token generation", the meaning was for queried permissions there, not eventual token break!

When you have created your application you have declared the possible scopes this application can have access to. Seems your declaration covers "sharing.write" permission needed by 2/sharing/create_shared_link_with_settings. On token generation you should select a subset of all scopes of your application (could be all available/selected for the application or less). If you have forgot some scope here, even selected for the application, it'll not be available for the application instances! That's why just "generate a new token" in such a case (if it is) wouldn't solve anything. If missing (something which I suspected), you should add it to the list of scopes in your application code (or configuration). That's it.

By the way, it's most likely @Greg-DB's proposal be the real issue.

Greg-DB
Dropbox Staff
Go to solution

@softwaremedicalshare The link ban I referred to does apply to the functionality you're trying to use. I recommend contacting support if you have questions about the status of your account.

softwaremedicalshare
New member | Level 2
Go to solution

I just finish a phone call with support. it was not issue with banning or permissions, it was a downloading "bandwidth" issue of the account (not a file) so I think dropbox api should  address in better way the problem issue.

 

Thanks for your help!

Need more support?