cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you’ve changed your email address, now's the perfect time to update it on your Dropbox account and we’re here to help! Learn more 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: 

problem initializing DropboxClient instance

problem initializing DropboxClient instance

attilagal
Explorer | Level 3
Go to solution

Hi all,

 

I could achieve file upload from Web API. I get the posted file, and I could upload it to dropbox and get shared URL of the upped file.

However, deploying the app to Azure, I get an exception when creating the DropboxClient object, and all information is: 

 

ErrorMessage: "shared_link_access_denied/"

ErrorResponse is a SharedLinkError.SharedLinkAccessDenied

Code is:

 

                    try
                    {
                        dropBoxClient = new DropboxClient(s, new DropboxClientConfig("Forecast5"));
                        remoteFilePath = String.Format("{0}/logo.jpg", formData["id"]);
                        var result = await dropBoxClient.Files.UploadAsync(remoteFilePath, WriteMode.Overwrite.Instance, body: fileStream);
                    }

 

No idea and what to try. Anyone with a suggestion or idea?

 

Thanks in advance!!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The constructor and the UploadAsync method don't raise a SharedLinkAccessDenied. It looks like you're actually calling GetSharedLinkMetadataAsync somewhere. 

 

Anyway, SharedLinkAccessDenied means that the "caller is not allowed to access this shared link". That is, it sounds like the user for the access token you're using doesn't have access to the shared link you're passing in to GetSharedLinkMetadataAsync.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The constructor and the UploadAsync method don't raise a SharedLinkAccessDenied. It looks like you're actually calling GetSharedLinkMetadataAsync somewhere. 

 

Anyway, SharedLinkAccessDenied means that the "caller is not allowed to access this shared link". That is, it sounds like the user for the access token you're using doesn't have access to the shared link you're passing in to GetSharedLinkMetadataAsync.

attilagal
Explorer | Level 3
Go to solution

Fuh, you were right!

Due to a bad error handling and awful debugging experience, it was really because of accessing a wrong url as shared link.

Thank you very much!!!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    attilagal Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?