cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Dropbox API - files/list_folder : request body: could not decode input as JSON

Dropbox API - files/list_folder : request body: could not decode input as JSON

KR23
Helpful | Level 5
Go to solution

I have a windows app that creates an HTTP request.  When I use apis that don't have arguments, everything works fine, but when I use one that needs arguments in the body like the files/list_folder, I can never get it to work.  I'm definitely putting json in there, but for some reason it doesn't recognize.  I've tried it as a string and also blob, with and without UTF8 encoding and always get the same error.  Here is my ful request as trapped from Fiddler:

POST https://api.dropboxapi.com/2/files/list_folder HTTP/1.1
Connection: Keep-Alive
Content-Type: application/json
Authorization: Bearer mytoken
User-Agent: api-explorer-client
Content-Length: 14
Host: api.dropboxapi.com

{"path":"/mysharedfolder"}

 

I have also tried it with no folder just "" and same error.

1 Accepted Solution

Accepted Solutions

KR23
Helpful | Level 5
Go to solution

Ok I figured out what was wrong.  I needed to use a UTF8 blob not string in my request.SetBody.  I guess I never tried the blob as UTF8 only ansi.  Anyway, I'm all set now.

View solution in original post

1 Reply 1

KR23
Helpful | Level 5
Go to solution

Ok I figured out what was wrong.  I needed to use a UTF8 blob not string in my request.SetBody.  I guess I never tried the blob as UTF8 only ansi.  Anyway, I'm all set now.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    KR23 Helpful | Level 5
What do Dropbox user levels mean?