Skip to content

Fusion Forge API Notes

Pan, Kevin Zhu edited this page Apr 11, 2022 · 5 revisions

Authentication:

Downloading a file:

https://forge.autodesk.com/en/docs/data/v2/tutorials/download-file/

  1. First navigate to the hub -> project -> folder (-> subfolder)

    • For our purposes, we know the hub id (Bechtel Center), project (will make a project supporting file syncing service), folders associated with project (one for each machine group) and can ignore subfolders
    • Each file (not folder) will have both a item and version associated with it
    • API endpoint for getting contents of folder: https://developer.api.autodesk.com/data/v1/projects/:project_id/folders/:folder_id/contents
  2. We can download an item using the get the storage id from the version of that item

    • API endpoint for downloading item: https://developer.api.autodesk.com/oss/v2/buckets/:bucket_key/objects/:object_name
      • bucket_key should just be 'wip.dm.prod'
      • object_name gathered from previous step, using the version of a file
    • Returns text
  3. Save response body to a file

    • Testing in Postman, file saves as correct type but is named after the object_name which is an id, not the actual file name
      • Would not be hard to rename the file, but should double check the formatting outside of Postman