Error renaming folder name via Update Folder using cURL

回答済み
新規投稿

コメント

3件のコメント

  • 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)?

    0
    コメントアクション パーマリンク
  • 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.

    0
    コメントアクション パーマリンク
  • 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 https://api.box.com:443/2.0/folders/FOLDER_ID?fields=name -H "Authorization:Bearer ACCESS_TOKEN" -H "Content-Type: application/json" -d "{\"name\":\"NEW_FOLDER_NAME\"}" -X PUT

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。