Box Rest APIv2: Move File or Folder

你。 提交于 2019-12-23 14:50:14

问题


There is a move operation in v1 API.

But is there any equivalent for v2 Rest API? There is copy function in V2, I tried to replace it as move but no love, with operation not permitted error or something like that:

curl https://api.box.com/2.0/files/FILE_ID/move \
  -H "Authorization: BoxAuth api_key=API_KEY&auth_token=AUTH_TOKEN" \
  -d '{"parent": {"id" : FOLDER_ID}}' \
  -X MOVE

回答1:


You can do this by updating the parent of the item via a PUT request i.e.

curl https://api.box.com/2.0/files/FILE_ID \
    -H "Authorization: BoxAuth api_key=API_KEY&auth_token=AUTH_TOKEN" \
    -d '{"parent": {"id": "THE_NEW_PARENT_ID"}}' \
    -X PUT


来源:https://stackoverflow.com/questions/12038068/box-rest-apiv2-move-file-or-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!