从存储桶中删除文件。欧特克锻

时间:2016-11-23 08:51:52

标签: autodesk forge autodesk-forge autodesk-data-management autodesk-bim360

从wip.dm.prod存储桶删除文件时出现问题(“errorCode”:“AUTH-012”)。但我可以使用-x GET而不是-x DELETE下载当前文件。

我使用本教程 - > https://developer.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-DELETE/。附上以下示例。

请求

curl 
-v https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/de34f4c9-457c-4653-a9e4-8bbad12bf5ec.rvt 
-X DELETE 
-H "Authorization:Bearer G3fqI9NFKqJVN5MQy3yI0tGXXXXX"

响应

{  
   "developerMessage": "ACM check failed, user or calling service does not have access to perform this operation",  
   "userMessage": "",  
   "errorCode": "AUTH-012",
   "more info": "http://developer.api.autodesk.com/documentation/v1/errors/AUTH-012"
}

请你检查我并解释一下可能出现的问题?

1 个答案:

答案 0 :(得分:0)

对于文件删除,我们可以使用文件版本的删除。

curl 
-v https://developer.api.autodesk.com/data/v1/projects/{project_Id}/versions
-x POST
-H "Authorization:Bearer G3fqI9NFKqJVN5MQy3yI0tGXXXXX"
-H "Content-Type:application/vnd.api+json"
-d '{
  "jsonapi": {
    "version": "1.0"
  },
  "data": {
   "type": "versions",
   "attributes": {
     "extension": {
       "type": "versions:autodesk.core:Deleted",
       "version": "1.0",
     }
   },
   "relationships": {
     "item": {
       "data": { 
            "type": "items", 
            "id": "urn:adsk.___your_file_id__________" 
         }
       }
     }
   }
 }'

其中:

{project_Id} - 是您的项目ID;

“urn:adsk .___ your_file_id__________” - 是您的文件ID。