Box Rest APIv2:移动文件或文件夹 [英] Box Rest APIv2: Move File or Folder

查看:94
本文介绍了Box Rest APIv2:移动文件或文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在v1 API中有一个移动操作

There is a move operation in v1 API.

但是v2 Rest API有等同功能吗? V2中有复制功能,我尝试将其替换为 move 但没有爱,操作不允许错误或类似的东西:

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


推荐答案

您可以通过PUT请求更新项目的父项,即

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

这篇关于Box Rest APIv2:移动文件或文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆