cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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: 

Testing the upload API via postman fails and returns error

Testing the upload API via postman fails and returns error

RaviDixit15
New member | Level 2

I am working on Xamarin forms application and trying to use the REST API of dropbox to upload files in dropbox and hence for testing i tried to make a postman call to upload files into dropbox, it seems to work on the API explorer of dropbox but on the postman it fails even though i pass all the required parameter as explained in the API explorer.

 

I am not sure what i am doing incorrect here OR if this is a bug or something not sure

 

Please let me know if i can make calls via postman OR some issue with my header request.

 

Given is the error message i am getting

 

Error in call to API function "files/upload": Bad HTTP "Content-Type" header: "multipart/form-data; boundary=--------------------------387630636170231897718145".  Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".

Postman error messagePostman error message

 

 

 

 

 

 

 

4 Replies 4

Re: Testing the upload API via postman fails and returns error

Mark
Super User II
*moves to API area*

 


:penguin::penguin: - :penguin: - :penguin: - :penguin:


Heart Did this post help you? If so please mark it for some Kudos below. 


:white_check_mark: Did this post fix your issue/answer your question? If so please press the 'Accept as Solution' button to help others find it.


:arrows_counterclockwise: Did this post not resolve your issue? If so please give us some more information so we can try and help - please remember we cannot see over your shoulder so be as descriptive as possible! 


 

Re: Testing the upload API via postman fails and returns error

Greg-DB
Dropboxer
The /2/files/upload endpoint expects one of the cited "Content-Type" request headers, ideally "Content-Type: application/octet-stream". Based on the error message though, it appears your client is overriding your header setting and sending something else ("multipart/form-data; boundary..."). I can't offer support on configuring Postman itself, as it's made by a third party, but it's probably a matter of configuring the "Body" tab properly. I.e., make sure it's set to "binary". (Additionally, that "charset" would be part of the "Content-Type" header value itself, not another header. You probably don't need to set that anyway though.)

Also, this would be a different issue, but your "Dropbox-API-Arg" value is incorrect. It should be the JSON for the API call parameters per the documentation: https://www.dropbox.com/developers/documentation/http/documentation#files-upload

Re: Testing the upload API via postman fails and returns error

RaviDixit15
New member | Level 2

I will try to check with postman once again based on your comments thanks for the guidance, one more thing is reason why i tried to use the API and not the dropbox native client for xamarin is that when it i try to run the iOS project i get an exception which says Dropbox client not found, i guess i will raise a new ticket for that.

 

Is there any sample which uses the latest nugget package for dropbo client with .net framework 2.0?

 

 

Re: Testing the upload API via postman fails and returns error

Greg-DB
Dropboxer
For .NET, we recommend using the official Dropbox API v2 .NET SDK if possible:

https://github.com/dropbox/dropbox-sdk-dotnet

There examples included with that here:

https://github.com/dropbox/dropbox-sdk-dotnet/tree/master/dropbox-sdk-dotnet/Examples
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    RaviDixit15 New member | Level 2
  • User avatar
    Mark Super User II
What do Dropbox user levels mean?
Need more support?