cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

C# API call "https://api.dropboxapi.com/2/files/list_folder" 400 (Bad Request)

C# API call "https://api.dropboxapi.com/2/files/list_folder" 400 (Bad Request)

frphotos
Explorer | Level 4

I am getting (400) Bad Request from the below call in c#.

 

 

string Url = "https://api.dropboxapi.com/2/files/list_folder";
using (WebClient client = new WebClient()) { NameValueCollection values = new NameValueCollection(); string datastring = "path="; client.Headers.Add("Authorization", "Bearer MYTOKEN"); client.Headers.Add("Content-Type", "application/json"); string retval = client.UploadString(Url, "POST", datastring); }

Not sure why it is giving 404. I searched online without any solution to this problem.

 

 

I changed the 

string datastring = "path=";
string datastring = "path=''";

It also not working

2 Replies 2

Re: C# API call "https://api.dropboxapi.com/2/files/list_folder" 400 (Bad Request)

Greg-DB
Dropboxer
Can you print out the response body? It should contain a more useful error message.

Re: C# API call "https://api.dropboxapi.com/2/files/list_folder" 400 (Bad Request)

frphotos
Explorer | Level 4

Thanks Greg,

I scrapped the idea of using the API call. Instead I am using the .Net SDK method to call the api.

 

Thanks for the help.

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
    frphotos Explorer | Level 4
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?