Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

KR23's avatar
KR23
Helpful | Level 5
7 years ago
Solved

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

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.

  • 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.

1 Reply

  • KR23's avatar
    KR23
    Helpful | Level 5
    7 years ago

    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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

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!