0

I'm currently trying to delete a file that I uploaded to one of my A360 Projects. I found this Deleting a file from bucket. Autodesk-forge while searching for a solution. As far a I unterstood you can't directly delete a file, instead you have to remove the version. Am I right? So I followed his introduction. My code looks like this:

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",
});

When I send my request I get the following response

{"jsonapi":{"version":"1.0"},"errors":[{"id":"887fd9e4-8cf0-4d73-8e6a-64f3e442e189","status":"400","code":"BAD_INPUT","title":"One or more input values in the request were bad","detail":"Request input is invalid for this operation."}]}

Anyone knows what I'm doing wrong?

Community
  • 1
  • 1
Timo
  • 3
  • 3

1 Answers1

0

I also tried to get the real storage of the version (in the bucket A360 created) , e.g. urn:adsk.objects:os.object:wip.dm.prod/24057ee9-7867-4643-b59f-1a6d53949bc1.rvt, then extracted bucket key and object key, finally tried with DELETE buckets/:bucketKey/objects/:objectName. However this failed (bad request).

Finally I am confirmed by our engineer team DELETE isn't supported through Forge-DM for the scenario to manipulate A360 files. And the way I tried (deleting an OSS object from a WIPDM-managed version )also won't work and is not a supported use case either.

The other post you found only applies to the file in BIM360 Docs.

Sorry if this is a bad news to you. I am checking further with team if there is any plan/wish that in the plate.

Community
  • 1
  • 1
Xiaodong Liang
  • 2,051
  • 2
  • 9
  • 14