Getting 404 error on loading 3D model of autodesk forge - manifest

I am working on the Autodesk forge 3D models (.rvt,.ifc,.pdf etc) .And when I select any model and it uses https://developer.api.autodesk.com/derivativeservice/v2/regions/eu/manifest/{urn} api to load the model after that If I open any model it won't open because of the 404 error. And if I open that particular model for the very first time It loads properly.
Can anyone help me finding the reason of 404 (model not found) on autodesk developer api?

Assuming that you are using OSS (buckets/objects), you must ensure the Data Retention Policy of the bucket where your files are. If your bucket is transient, files are deleted after 24 hours.
Using Get bucket details endpoint, you'll find the retention policy of your bucket.
Then you can also use Get Objects endpoint to list files in bucket.

Related

BIM Metadata Extraction - Automation - Using AWS S3 bucket and Autodesk Forge Model Derivative API

We are trying to implement an automation workflow as described below. Please let me know if it is possible to implement or not.
The workflow is going to be like this.
A user uploaded the Revit model to the AWS S3 bucket
2)The Autodesk Forge model derivative API automatically fetches that model from the AWS S3 bucket
The model derivative API then extracts the metadata from the translated model and exports the metadata into an SQLite or JSON format and saves back that database file into the same AWS S3 bucket.
This is feasible. you may combine a couple of services of AWS. I had similar practice long time ago. Probably it could be a reference
https://forge.autodesk.com/blog/2-legged-workflow-model-translation-part-1
https://forge.autodesk.com/blog/2-legged-workflow-model-translation-part-2
Note: some usage of AWS services may have changed. Forge side, the endpoints (using SDK) may be still working, but you also need to double test adjust if anything is tuned.

Fetch Metadata of a model using model derivative api (Forge)

I was trying some hands on with forge services, I want to fetch few object's properties inside of a revit model uploaded on bim360/ACC, for which I am calling two API's 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job' for translating the job to svf and then calling API "https://developer.api.autodesk.com/modelderivative/v2/designdata/" + urn + "/metadata/" (with urn of the translated job) (failed when passed urn of revit file directly)
Can we not directly get the metadata/properties without converting the file to svf? Since translating to svf is taking a lot of time for large files, my motive is to decrease the time to fetch the properties, can you share any solutions if you think of any please?
Yes, you are correct in assuming that you need to translate to SVF in order to access any BIM element properties at all. It's either that, or open it in desktop Revit and access the data there. Also discussed in the Revit API discussion forum thread on fetching metadata of a model using Forge model derivative API.

Application level access management for models accessed through the forge viewer

I have added the forge viewer to a web application in which different users may have access to different drawings/models.
Our current implementation of this functionality makes our own backend function as a proxy between our frontend and the Autodesk Forge API. Here, the backend adds the Authorization header after authenticating to the Autodesk API.
While this is fine for uploading and translating models to an Autodesk bucket, retrievel of these translated models by the Viewer through our own backend as a proxy seems unnecessary. For example, Azure or AWS object storage allows for creating private buckets that can be accessed directly through a "signed" URL. This way the frontend client only has to obtain such a signed URL from the backend and can then retrieve the file from the Azure/AWS bucket directly.
Is it possible to do something similar (creating a private bucket that can be accessed directly from the client) with the Autodesk Forge API?
If not, would it possible to store the translated model SVF file in our own Azure/AWS bucket and point the viewer to that location instead? This way we use Autodesk Forge for translation of the model and we can control access through private buckets in Azure/AWS.
To your first question (creating a bucket that could be accessed directly by a client), unfortunately that is not something we support.
Regarding the possibility to serve SVF files yourself, and point Forge Viewer to their custom locations, that is possible but not recommended. The only requirement of the Terms of Use is that the Forge Viewer assets (JavaScript, CSS, images, etc.) must be served from the Autodesk domain.

Can you query, translate, and open .dwg files from web.autocad.com's Web & Mobile directories?

Background: I have a simple integration (Client App) using the Forge API that can: create a bucket, upload a .dwg file to the object storage service, translate the file (and get translation status), query the files in a bucket, and open any of the files in the bucket in the Viewer. I'm now researching the possibility to pull files that are made/modified from the AutoCAD Web & Mobile App (https://web.autocad.com/) (aka the Web App) via the forge API. Is this possible?
Usecase: We want some personnel to be able to modify the underlying files, whereas others just need to view it from an existing application integrated through forge. The idea would be the engineers would modify the file in the Web App, and then from the Client App using the forge API, I want to query to see if the base file has been updated since the last time it was translated for the viewer. If newer, re-translate the file and view it. If not, just view it.
Attempts: I assumed the files would be in a project in a hub in the /project/v1/hubs/ in the data management API of Forge, but I'm getting a response of "You don't have permission to access this API". I am in the trial version of forge, so that may be the issue. And the Web App is currently "free for everyone for an extended period." Is it possible that I just need to purchase one of the subscriptions to be able to access the files I have on the web app? Or am I looking in the entirely wrong place?
So, concisely, here are the questions:
Are files that are saved on https://web.autocad.com/ accessible via the Forge API? How, if yes?
If yes to #1, do these files need to be converted using the Forge API to be render-able in the Viewer?
Thank you for your time and help!
I would say, it's a pretty cool idea and workflow, but unfortunately, AFAIK, we don't have direct access to file on https://web.autocad.com/ by Forge API currently, only data within Autodesk SAAS applications include BIM 360 Team, Fusion Team (formerly known as A360 Team), BIM 360 Docs, A360 Personal could be accessed directly, refer https://forge.autodesk.com/en/docs/data/v2/developers_guide/overview/, But some ideas:
I am not expert on https://web.autocad.com, but I know it provides the connection to cloud storage including Box, Dropbox, Google Drive, and Microsoft OneDrive, depends on which cloud storage you are using, you should pick the corresponding API to access the file, and maybe check if the file is changed, all of that is nothing to do with Forge, but the cloud storage.
If you can check the file version with the API from cloud storage provider, then you should be able to exchange the file between the cloud storage and Autodesk OSS(check sample https://github.com/Autodesk-Forge/bim360appstore-data.management-nodejs-transfer.storage ), you can use the Forge to translate and view files on Autodesk OSS.

Delete source file after translation

is it possible to delete the source file from Autodesk Forge once the translation is complete and still be able to view the translated file in the viewer? If so which endpoints from the APIs should be used to achieve this?
There are two API to delete files on the Forge platform:
DELETE buckets/:bucketKey/objects/:objectName: call this API to delete uploaded model raw files such as RVT, NWD, IFC, OBJ, STL and etc. stored on your own Forge OSS bucket (Forge Data Management API). But this might be unnecessary, the upload files should be removed after 24hours or a month regarding the bucket policies, unless these files are uploaded to a bucket with Persistent policy, see here for the bucket policies.
DELETE :urn/manifest: call this API to delete all derivative bubbles(i.e. the translated files) generated via POST job of the Forge Model Derivative API.