0

I am working on a Revit plugin that runs on Forge. The plugin will process Revit files that are on BIM 360. I can get a URL to download Revit documents from BIM 360 by following these steps:

https://forge.autodesk.com/en/docs/bim360/v1/tutorials/document-management/download-document/

But that is not a signed URL, Forge Revit apps need a signed URL according to:

https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step7-post-workitem/

How can I get around this issue? Is there a way to get a signed URL from BIM 360? Is there a way to pass an unsigned URL in my workitem to Forge?

2 Answers2

0

Yes this is very much possible. look into this endpoint. If I am not mistaken this generates a signed url that can be used in the context you are describing.

Cheers

Ps: Thanks for asking this question, I did not know this feature excisted aswell!

EDIT

This is not yet implemented for files living in BIM360 but might be relevant in the future when this functionality does get implemented

  • The link you provided seem to show how to create a singed URL, I think I still need to upload my Revit file there after downloading it from BIM 360. I am trying to avoid the redundant download (from the un-signed url) and upload to signed URL workflow. I am hoping to get a signed URL directly from BIM 360. – Ehsan Barekati Jun 10 '20 at 22:24
  • This endpoint creates a signed url from an already excisiting file in a bucket. If your file is already on BIM360 you can get the object data using forge. No need to reupload. – Samuel Middendorp Jun 10 '20 at 22:59
  • Oh my bad! Talked too soon. Ok it makes sense, but I am still getting an error it says: Only the bucket creator is allowed to access this api. I am not the creator of the bucket, is there any way around this? If my account is designated as developer, would that fix the issue? – Ehsan Barekati Jun 11 '20 at 00:27
  • Seems this is not [implemented fully yet](https://stackoverflow.com/questions/59544843/create-signed-url-for-object-in-bim360-oss) for files living in BIM360 unfortunately. A Workaround would be to create your own signed URL by downloading a file and making it accesible in a way (very redundant I know) cheers – Samuel Middendorp Jun 11 '20 at 05:41
0

Unfortunately, you can not create signed URL for your BIM360 files using https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-signed-POST/, the reason is that creating Signed Url requires bucket owner access, and you are not the bucket owner of BIM360 files :(.

But we do have some other ways to download or upload file to BIM360 docs from Revit DA directly by providing the user token in the header, in short, it would be like:

{
"activityId":"{{dasNickName}}.CreateWindowFamilyActivity+dev",
"arguments":{
    "templateFile":{
        "url":"https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/72d5e7e4-89a7-4cb9-9da0-2e2bbc61ca8e.rvt",
                  "Headers":{
                    "Authorization":"Bearer {{3leggedAccessToken}}"
                }
    },       
    "outputFamily":{
        "verb":"put",
        "url":" https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/2a6d61f2-49df-4d7b.rvt",
        "Headers":{
                    "Authorization":"Bearer {{3leggedAccessToken}}"
        }
    }
}

}

For more information, please check the blog post at https://forge.autodesk.com/blog/upload-your-design-automation-output-file-bim360-docs

Zhong Wu
  • 1,721
  • 1
  • 8
  • 9