0

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

我使用本教程 - >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" 
} 

你能请我解释一下我是什么地方出错了?

+0

你为什么要使用-stg(stagging)环境? –

+0

只是在我的笔记错误。感谢您的更正。 –

+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。

相关问题