Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
we are accessing having a problem in URL we have a file named xyx (1).jpg while passing this to server we are getting response as Unauthorized Access. May I Know how to pass this request to Server?
Here am using DropBox API for Winrt C#.
For Thumbnails
string url = DriveUtilities.GenerateSignature(
new Uri(string.Format(AppConstants.DropBox_GetThumbnail, item.serverFileId), UriKind.RelativeOrAbsolute),
"GET", drive.AccessToken, drive.RefreshToken);
Stream fileStream = await FileHelper.getFileInputStream(url);
if (fileStream != null)
{
try
{
if (fileStream.Length > 0)
await FileSaveToStorage(fileStream, file);
handler(fileStream);
}
catch (Exception ex)
{
}
}
for full image we are using this code (working)
WebProvider objWebProvider = new WebProvider();
string size = "?size=" + await CommonFunctions.GetThumbnailSize(DriveType.DROPBOX);
var uri = DriveUtilities.GenerateThumbviewSignature(
new Uri(string.Format(AppConstants.DropBox_GetThumbnail, path) + size, UriKind.RelativeOrAbsolute),
"GET", DropBox_AccessToken, DropBox_AccessTokenSecret);
url = uri.ToString();
I'm confused.
What's the difference between DriveUtilities.GenerateSignature
and DriveUtilities.GenerateThumbviewSignature
?
And why does one piece of code use item.serverFileId
and the other path
? (Is the "serverFileId" the path?)
And both snippets seem to use AppConstants.DropBox_GetThumbnail
as the base URL, but I thought the second code snippet was supposed to be retrieving the full image (not a thumbnail).
Yes the second one is for getting full image. No need to confuse we used same method but only the name is different here path and item.serverField means name of that particular image. In both cases everything is same except the URL. The url is different for full view image and thumbnail.
What's the value of AppConstants.DropBox_GetThumbnail
?
DropBox_GetThumbnail = "https://api-content.dropbox.com/1/thumbnails/auto{0}"; {0} means we are appending image information here.
Both code snippets use AppConstants.DropBox_GetThumbnail
. So they both seem to be requesting thumbnails.
Another issue I noticed: the first code snippet passes drive.AccessToken
and drive.RefreshToken
. Dropbox doesn't use a refresh token. Presumably you should be passing the access token secret as the second parameter.
Okay. Thanks for your support.
Hi Actually I sent you wrong code regarding success case.
Here it am sending you again.
WebProvider objWebProvider = new WebProvider();
// path = WebUtility.UrlEncode(path);
var uri = DriveUtilities.GenerateSignature(
new Uri(string.Format(AppConstants.DropBox_GetMediaItem, path), UriKind.RelativeOrAbsolute),
"GET", DropBox_AccessToken, DropBox_AccessTokenSecret);
uri = await objWebProvider.GETRequest(uri).ConfigureAwait(false);
if (!string.IsNullOrEmpty(uri) && !uri.Equals(AppConstants.Unauthorized))
{
DropBoxThumbnail result = JsonConvert.DeserializeObject<DropBoxThumbnail>(uri);
if (result != null)
url = result.url;
}
Are you still having trouble, or is your code working now?
Hi there!
If you need more help you can view your support options (expected response time for a 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!