0

I have tried to rename the folder with this PATCH API

this is request body : { "jsonApi": { "version": "1.0" }, "data": { "id": "urn:adsk.wipprod:fs.folder:co.ZjOwQVYaQbewrWmwN9gBOg", "type": "folders", "attributes": { "name": "folder_new_name_3" } } } and this is the response : { "jsonapi": { "version": "1.0" }, "errors": [ { "id": "c6b15305-2522-4d66-8ebc-11e864ae54fa", "status": "400", "code": "BAD_INPUT", "title": "One or more input values in the request were bad", "detail": "Delete and Restore of BIM 360 folders are currently disabled for 3rd party applications." } ] }. What I'm doing wrong ? Am I missing something ? Is this patch Api the correct one to use for renaming folders in BIM 360 Docs ?

2 Answers2

0

Unfortunately PATCH for Rename on BIM 360 Docs is not supported at the moment. There is work being done on it so it becomes available in the future. Sorry for the bad news.

halfer
  • 19,824
  • 17
  • 99
  • 186
Jaime Rosales
  • 1,106
  • 1
  • 6
  • 8
  • There is a mentioned about it here https://forge.autodesk.com/blog/how-patch-apis-work-and-some-tips-using-patch-apis – Jaime Rosales Dec 12 '17 at 19:23
  • Thanks, I saw this [link](https://www.versti.eu/TranslateProxy/https/stackoverflow.com/questions/46473909/error-on-rename-bim360-file) and I believed that with folder it works. for BIM Docs I will try with patch of the version. – Giuseppe Signorelli Dec 13 '17 at 08:07
0

You are correct using this approach to rename a folder but it has been enabled lately only:

curl -X PATCH -H "Authorization: Bearer yxz"
 "https://developer.api.autodesk.com/data/v1/projects/a.project.id.xyz/folders/urn%3Aadsk.wipprod%3Adm.folder%3AhC6k4hndRWaeIVhIjvHu8w"
-d '{
  "jsonapi": {
    "version": "1.0"
  },
  "data": {
    "type": "folders",
    "id": "urn:adsk.wipprod:dm.folder:hC6k4hndRWaeIVhIjvHu8w",
    "attributes": {
      "name": "Plans"
    }
  }
}'

You can now delete a folder as well, like this, but note it is a soft delete vs a hard delete. This is way we use PATCH vs DELETE.

curl -X PATCH -H "Authorization: Bearer yyz"
 "https://developer.api.autodesk.com/data/v1/projects/b.project.id.xyz/folders/urn%3Aadsk.wipprod%3Adm.folder%3AhC6k4hndRWaeIVhIjvHu8w"
 -d '{
  "jsonapi": {
    "version": "1.0"
  },
  "data": {
    "type": "folders",
    "id": "urn:adsk.wipprod:dm.folder:hC6k4hndRWaeIVhIjvHu8w",
    "attributes": {
        "hidden": true
    }
  }
}'
cyrille
  • 2,616
  • 1
  • 10
  • 18