2

There are problem with deleting a file from wip.dm.prod bucket ("errorCode": "AUTH-012"). But I can download current file by using -x GET instead of -x DELETE.

I use this tutorial -> https://developer.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-DELETE/ . Attach an example below.

Request

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"

Response

{  
   "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"
}

Could you please check me and explain me what could be wrong?

Z44
  • 43
  • 8
  • why are you using -stg (stagging) environment? – Augusto Goncalves Nov 23 '16 at 11:26
  • Just mistook in my notes. Thanks for the correction. – Z44 Nov 23 '16 at 12:10
  • is it working now? not sure if what you posted is a solution or another question... also, consider removing access tokens from your questions as a malicious user can use it to access/write/read your data. – Augusto Goncalves Nov 23 '16 at 12:14
  • Yes, it's working fine now. We cannot delete content from 'OSS' after creating a Forge-DM version. That would be modifying the immutable data model. And the access token is modified in several places, saved only the total number of characters. Thank for your interest in my questions – Z44 Nov 23 '16 at 13:43

1 Answers1

1

For file deleting we can use deleting of file version.

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__________" 
         }
       }
     }
   }
 }'

Where:

{project_Id} - is your project id;

"urn:adsk.___your_file_id__________" - is your file id.

Z44
  • 43
  • 8