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。

相關問題