0

I'm trying to set up an Signed URL for an Design Automation Workflow which is triggered by an Webhook inside of the BIM360 OSS. If a file is added the webhooks triggers an endpoint to start a Design Automation. The webhook is working. And the Design Automation is working too. The Problem occurs if i try to wire both up. I#m trying to create a Signed URL of the File like suggested in this post from Petr Broz link stackoverflow.

To use this API it is requierd to use an Token which is obatined by 2-Legged-Auth which is working with all necessary Scopes. In the response of the Webhook is an ID for the Folder and Version. The API is recognizing the ID. The problem occurs in the response of this endpoint to create the signed url: https://developer.api.autodesk.com/oss/v2/buckets/:bucketKey/objects/:objectKey/signed

I'm using the wip.dm.emea as bucket because the file is stored in the EU BIM360 OSS.

The response is a 403 Forbidden:

{
    "reason": "Only the bucket creator is allowed to access this api."
}

Is it even possible to get the File ID like in this example Forge how to Download File ? Because this Solution requires a 3-Legged-Auth Flow which is not possible for a complete Automation.

The thing which makes me question is, that you can achieve this Workflow in plane Forge. But not in BIM360 where i have no control over the Buckets that are created by the System!?

I think this is an architectural missmatch between the Forge API and the BIM360 implementation!? Will there be a solution for this in the future?

Best regards Jan

JCK
  • 1
  • 1

1 Answers1

0

Unfortunately, I can confirm that it's not possible to create a signed URL for your BIM360 storage currently, as the error message mentioned, the endpoint requires the bucket owner to do this operation, this is what it is now. But I agree with you that this should be an architecture mismatch between Forge OSS and BIM360 implementation, and it's already been requested in our system, please keep "CPOSS-1066" to check with us about the progress.

As for the current way, you can keep the 3 legged token and using that for the output Url and also in the onComplete() callback, I have the blog post https://forge.autodesk.com/blog/upload-your-design-automation-output-file-bim360-docs which details the way to work, hope it helps at this moment.

Zhong Wu
  • 1,721
  • 1
  • 8
  • 9
  • Thanks for your quick response. I'm familiar with the solution you suggested. As I mentioned in our Worklfow is no 3 Legged available, because the Webhook is the starting point and has no Token to chache, during the lack of Userinteraction. But I will look forward and follow the Progress on "CPOSS-1066". – JCK Jan 01 '20 at 10:16
  • if so, did you check this sample that also start the design automation job from a webhook, it actually use a database to keep the userId with the token, and will send the userId while triggering a webhook at https://github.com/Autodesk-Forge/forge-checkmodels-createissues-revit/blob/master/web/Controllers/WebhookController.cs#L155 – Zhong Wu Jan 01 '20 at 22:41
  • Ok, i did a deeper look. Maybe you can help me to understand where the 3 Legged Token is generated? I unterstand that the token is stored in MongoDB Storage and is restored when needed. But it looks like that it's necessary to log in another App to get initial Token? Or is the inital token generated and stored by the Webhook by the plane BIM360 Client (not API)? As i mentioned we are looking for simpler and cleaner way of handling, than as using Workers to refresh a token in an ongoing process. Thanks ahead!!! – JCK Jan 05 '20 at 13:29
  • Yes, for this solution, you have to login to your App to generate the initial 3 legged token once, the token is required to access user's data in BIM360. After that, since you kept the userId and token in your database, you can always retrieve the valid token by the refresh token of userId. I believe this is the current way to solve this problem. – Zhong Wu Jan 12 '20 at 01:41