我目前正在尝试删除我上传到我的 A360 项目之一的文件。我发现这个从存储桶中删除文件。Autodesk-forge在寻找解决方案时。据我了解,您不能直接删除文件,而是必须删除版本。我对吗?于是我跟着他的介绍。我的代码如下所示:
var data = {
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "versions",
"attributes": {
"extension": {
"type": "versions:autodesk.core:Deleted",
"version": "1.0",
}
},
"relationships": {
"item": {
"data": {
"type": "items",
"id": <item_id>
}
}
}
}
};
$.ajax({
type: "POST",
url: "https://developer.api.autodesk.com/data/v1/projects/" + <project_id> + "/versions",
beforeSend: function (request) {
request.setRequestHeader("Authorization", "Bearer " + <access_token>);
},
data: JSON.stringify(data),
contentType: "application/vnd.api+json",
});
当我发送我的请求时,我得到以下响应
{"jsonapi":{"version":"1.0"},"errors":[{"id":"887fd9e4-8cf0-4d73-8e6a-64f3e442e189","status":"400","code":" BAD_INPUT","title":"请求中的一个或多个输入值错误","detail":"请求输入对于此操作无效。"}]}
有人知道我在做什么错吗?