Error renaming folder name via Update Folder using cURL

New post



  • mwiller

     I tried running the cURL command exactly as you have it there, and it seems to work just fine for me.  The error you're seeing indicates that the JSON body of your request couldn't be parsed correctly (though the command you pasted looks fine to me, and works fine when I run it).  Is there any way you can think of that the JSON might be getting malformed?  Maybe something with the quotes, or missing characters (e.g. commas between properties, closing braces)?

    Comment actions Permalink
  • ksendhil

    Thanks for your response, mwiller!


    I tried the same command in Git Shell, and it worked fine.  For some reason, it doesn't run in Windows Command Prompt.

    Comment actions Permalink
  • MattEB

    double-quote is a special character in cURL, so if you want to pass a double-quote you must escape it with backslash.  The box api documentation is misleading on the syntax to use for cURL.  For example, here is how to rename a folder. 


    cURL -H "Authorization:Bearer ACCESS_TOKEN" -H "Content-Type: application/json" -d "{\"name\":\"NEW_FOLDER_NAME\"}" -X PUT

    Comment actions Permalink

Please sign in to leave a comment.