Search code examples
autodesk-forgeautodesk-bim360autodesk-data-management

How to create a photo attachment for an issue with Autodesk Forge API?


I am trying to attach a photo via the Forge API to an issue like it does in BIM 360 when drag and drop files into the Attachments tab.

I tried to create a bucket, upload a file there and attach the uploaded file with "urnType" = "oss" using a POST request for attachments. But it crashes with 403 code at attacment post.


Solution

  • Try to follow this tutorial : Attach BIM360 Files

    The urnType should be "dm" in the POST request

    EDIT :

    If you want to upload pictures and be able to see it, you can use "oss" for the urnType but instead of using the urn of the picture from folderContents endpoint ex : urn:adsk.wip:dm.lineage:... use the objectId in the response of the upload ex : urn:adsk.objects:os.object:wip.dm.prod/xxxx-xxxx-xxxx-xx.png

    Then if you check the attachment details you'll get attachment-type:"photo" instead of "document" and be able to see the thumbnail in the issue details.

    I tried it and it worked for me (and you have one step less in the process of adding pictures attachment 😉)