Publish a File into a Project Folder
A 6-step recipe with Autodesk. We can help you get access.
Recipe · 6 steps
Publish a File into a Project Folder
with Autodesk · Project Management
Walk the hub/project/folder tree and publish a new file item.
- Find the hub by name. Everything in Data Management hangs off a hub, and its id is required to reach projects.
- Resolve the target project within the hub, filtering by the supplied project id so the flow fails loudly rather than writing into the wrong project.
- List the project's top-level folders. These are the roots the host product exposes (Plans, Project Files, and so on) and are the only valid parents for a first subfolder.
- Create the destination subfolder beneath the top folder. Data Management speaks JSON:API, so the parent is expressed as a relationship rather than a path.
- Create the item that represents the file in the folder, binding it to the storage object holding the bytes. The included array carries the first version of the item.
- Read the published item back to confirm it landed in the folder and to capture its display name and tip version as recorded by the service.
What you'll need to have ready
- hubName: The hub (Autodesk account or BIM 360 account) name to resolve.
- projectId: The project id to publish into (e.g. b.xxxxxxxx-xxxx-...).
- folderName: Name of the subfolder to create under the top folder.
- fileName: Display name for the published file item (e.g. "tower.rvt").
- storageObjectId: The storage object URN the file bytes were uploaded to, which the item and its first version point at.
- folderExtensionType: The folder extension type for the host product (e.g. "folders:autodesk.bim360:Folder").
- itemExtensionType: The item extension type for the host product (e.g. "items:autodesk.bim360:File").
- versionExtensionType: The version extension type for the host product (e.g. "versions:autodesk.bim360:File").
For your developer
Arazzo workflow autodesk:publish-file-into-project-folder, 6 operations: getHubs → getHubProjects → getProjectTopFolders → createFolder → createItem → getItem. Specs on APIs.io.