Forum Discussion

Sidwyn K.'s avatar
Sidwyn K.
New member | Level 1
10 years ago

Request Body: could not decode input as JSON)

Hi! Am using a simple call:

 

```

client.files.listFolder(path: "", recursive: false, includeMediaInfo: false, includeDeleted: false).response { response, error in

                if let listFolderResult = response {

                    print("These are the entries in the main folder:")

                    print(listFolderResult.entries)

                }

                else {

                    print("Error listing folder:")

                    print(error)

                }

            }

```

but it seems like even this doesn't work. I get the following message:

```

Optional([request-id 98201723db4f6b61cab0ca9ed2c3209b] Bad Input: Error in call to API function "files/list_folder": request body: could not decode input as JSON)

```

Any help would be appreciated. Thanks!

4 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Thanks for the report. This is a known issue with version 2.0.3 that we're working on.

    In the meantime, you can work around this by downgrading to 2.0.2 for now.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    This should be fixed now in release 3.0.0.

  • Jeff1's avatar
    Jeff1
    New member | Level 1
    10 years ago

    LS,

    I'm developing a mobile app with Xamarin and its trivial that Dropbox gets integrated.

    Ref: https://blogs.dropbox.com/developers/2015/04/a-preview-of-the-new-dropbox-api-v2/

    Now "users/get_current_account" works like a charm, but if i try "/files/list_folder" with "{\"path\": \"\"}" as body, the response i get is "Error in call to API function "files/list_folder": request body: could not decode input as JSON", whilst using fiddler.

    Am i overlooking something (obvious)?

    Can someone give me more info on this?

     

    Screenshots:
    200 https://img42.com/wA7gP
    400 https://img42.com/ufrLJ

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Hi Jeff, for future reference, please only post once per issue. Also, this thread was about using the SwiftyDropbox. It sounds like you're not using that, so if you still need help, please start a new thread. Also, please show the request for the failing API call in your new thread. Thanks!

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!