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?