问题
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