Is it possible to delete or overwrite document in BIM360 Docs using API?

我只是一个虾纸丫 提交于 2021-01-29 07:21:47

问题


When we upload the document in BIM360 docs folder, the document is not overwritten if it exists already.

What we want to do is, if a document already exists. then upload code should be overwritten the document. Or delete the existed document and upload a new one.

We have not found any API which can delete BIM360 docs.


回答1:


To remove items from BIM360 Docs' folder, please call POST projects/:project_id/versions with this body and fresh your web browser if you're opening the folder page that contains this item, then you will see it has been moved into "Deleted Items":

{ 
   "jsonapi":{ 
      "version":"1.0"
   },
   "data":{ 
      "type":"versions",
      "attributes":{ 
         "extension":{ 
            "type":"versions:autodesk.core:Deleted",      //!<<< The key of this action
            "version":"1.0"
         }
      },
      "relationships":{ 
         "item":{ 
            "data":{ 
               "type":"items",
               "id":"{{ItemId}}"                          //!<<< e.g. urn:adsk.wipprod:dm.lineage:8ucohSiktGeEqDn4SX75cA of id of the item you want to delete
            }
         }
      }
   }
} 

Note. Files uploaded onto BIM360 Docs are not deletable really, all of them are just hidden or moved into the "Deleted Items" after calling this API or clicking delete button on the BIM360 Web UI.



来源:https://stackoverflow.com/questions/53967455/is-it-possible-to-delete-or-overwrite-document-in-bim360-docs-using-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!