Home > Software design >  Overwrite BIM360 file using Design Automation
Overwrite BIM360 file using Design Automation

Time:08-05

So, I need to "overwrite" a file in BIM360 with the result file from Design Automation Plugin. The Design Automation Plugin makes some changes to elements, but the changes don't show up in BIM360 files. So far I have tried using the same upload URL with PUT verb. Here is the example of XrefTreeArgument of the WorkItem that gets submitted to Design Automation.

            var resultRvtArgument = new XrefTreeArgument
            {
                Url = inputFileArgument.Url, //https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/*filename*.rvt
                Verb = Verb.Put,
                Headers = new Dictionary<string, string>
                {
                    { "Authorization", "Bearer "   Context.AuthToken.AccessToken }
                }
            };

The problem is that WorkItem is showing a "FailedIpload" error. Here is the part of the report:

Response Body: {"developerMessage":"ACM check failed, user or calling service does not have access to perform this operation","userMessage":"","errorCode":"AUTH-012","more info":"http://developer.api.autodesk.com/documentation/v1/errors/AUTH-012"}

The download from BIM360 goes through successfully, and the token has the required scopes (e.g. data:write, data:read, bucket:update, etc.), but it fails on the upload to BIM360. Is there a way to overwrite, or change an existing BIM360 file, saving the name and other properties using Design Automation?

CodePudding user response:

The way provided in the question for uploading is deprecating, see here. Please follow the endpoint to request an S3 signed URL to upload the object. Please also consider to use the endpoint to request a signed URL to download an object.

CodePudding user response:

The error you have AUTH-012 indicates invalid token. Is this a 3 legged token belonging to the user who has write access to the object (*filename*.rvt)? Objects in wip.dm.prod bucket are owned by BIM 360 or ACC. Have you successfully been able to upload to this object from outside design automation using the same url and access token?

As per BIM 360 Document Management Step 6: Generate a Signed S3 URL you need to create a signed s3 url using a 3 legged token. When you have the signed URL you can include that in the output argument for the workitem in Design Automation.

  • Related