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

Forum Discussion

Shilpa M.'s avatar
Shilpa M.
New member | Level 1
10 years ago

Not getting response when I call "2/files/listfolder" method

Hi

I passed "https://api.dropboxapi.com/2/files/list_folder" to fetch files and folder from root.

and Passed parameters are:-

string path=string.empty;

request.AddHeader("Content-Type","application/json");

request.AddParameter("path", path);

but I got response from api is folollowing:

Error in call to API function "files/list_folder": Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded".  Expecting one of "application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack".

and StatusDescription "BadRequest"

 

Could you please suggest me?

Thanks

15 Replies

Replies have been turned off for this discussion
  • Shilpa M.'s avatar
    Shilpa M.
    New member | Level 1
    10 years ago

    How i can uplaod a new version for any file using API.

    I have try  

      string data = String.Format("/2/files/upload");
                string responseStr = ";

                RestRequest request = FormRequest(Method.POST, data, false);
                IRestResponse response = new RestSharp.RestResponse();

    string fullPathToUpload = metadataJson.path;
                    string path = string.Format("{1}\"path\":\"{0}\",\"mode\":{1}\".tag\":\"update\",\"update\":\"{3}\"{2}{2}", fullPathToUpload, "{", "}", rev);
                    request.AddHeader("Dropbox-API-Arg", path);
                    request.AddHeader("Content-Type", "application/octet-stream;");
                    request.AddParameter("application/octet-stream", externalFile.InputBytes, ParameterType.RequestBody);
                    response = executeRequestContent(request);
                    responseStr = response.Content;
                    status = response.StatusDescription;

    but found nothing got changes in Dropbox account. Plz help.

     

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

    What's the response from the API to this call?

  • Shilpa M.'s avatar
    Shilpa M.
    New member | Level 1
    10 years ago

    I got file information in response. but when when i check it in my Dropbox account and file version not getting update and file modified time remain unchanged.

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

    Are you attempting to upload the same exact data as is contained in the current version? Uploading an identical version of a file doesn't create a new revision.

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!