Search code examples
javascriptautodeskautodesk-data-management

How to display an image, type "items:autodesk.bim360:File", in HTML, which I uploaded to ACC Files tool using the Data Management API


I uploaded an image to ACC Files using Data Management API following this documentation and added a reference between the image and an Issue following this.

And there's the image uploaded

All I want is a link where I can put in <img src="HERE"> to display that image.

With the issue container id I found the container references and then the versions of the file (png image), but in versions response there's no link which I can put in src.

Is there a way to get the blob of the image 64 based? Or there's other way to display it?


Solution

  • While this might seem like a trivial feature to ask for, please note that Autodesk Platform Services (that the Autodesk Construction Cloud product is built on top of) is designed to display complex 3D views and 2D drawings in a specialized Viewer that's provided as a JavaScript library. Displaying a simple raster image in an <img> element is also possible but will require more work.

    For example, you could point the image element to a custom endpoint on your server which would download the image from ACC (as explained in this tutorial) and send it back to the client.

    Or, you could create a temporary signed URL (using this endpoint) pointing to the actual S3 object that stores your image, and use that URL as the src property of the <img> tag.