cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to upload files in Dropbox API v2 C# using Nemiro.OAuth

New member | Level 1
New member | Level 1

I'm trying to upload file but showing me 400 error.I'm trying the below code for file upload-
 
    RequestResult strReq = OAuthUtility.Post
                                         (
                                           endpoint: "https://content.dropboxapi.com/2/files/upload",
                                           parameters: new HttpParameterCollection
                                            {
                                                {"path", "path"},
                                                {"autorename","false"},
                                                {stream}
                                            },
                                           authorization: AccessToken,
                                           contentType: "application/octet-stream"
                                         );

I couldn't find the reason for this error.I'm following the upload instructions provided here( https://www.dropbox.com/developers/documentation/http/documentation#files-upload ) but it is not helpful for C#.
Any help will be appreciated.

3 Replies 3
Highlighted

Re: How to upload files in Dropbox API v2 C# using Nemiro.OAuth

Dropboxer
Dropboxer

[Cross-linking for reference: https://stackoverflow.com/questions/38122113/how-to-upload-files-in-dropbox-api-v2-c-sharp-using-nem... ]

What is the body of the response? It should contain more helpful error information.

Highlighted

Re: How to upload files in Dropbox API v2 C# using Nemiro.OAuth

New member | Level 1
New member | Level 1

Please see the screenshot @Gregory

Highlighted

Re: How to upload files in Dropbox API v2 C# using Nemiro.OAuth

Dropboxer
Dropboxer

You can see the error message in the "Result" line. It indicates that you need to supply the parameters in the "Dropbox-API-Arg" header, or "arg" URL parameter.

You can find more information on how to use this endpoint, along with an example using curl, in the documentation:

https://www.dropbox.com/developers/documentation/http/documentation#files-upload

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?