Autodesk Forge .net SDK 获取对象
Autodesk Forge .net SDK Get Object
我在使用 Forge .net SDK 从 bim 360 文档中心下载文件时遇到问题。
我正在使用具有以下范围的三足身份验证:-
数据:读取data:writedata:createdata:searchbucket:createbucket:readbucket:updatebucket:delete
它给我以下错误:-
调用 GetObject 时出错:{"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"}
下面的 Get 调用代码,存储桶键和对象名称来自本示例中第 4 步的项目存储位置 https://developer.autodesk.com/en/docs/data/v2/tutorials/download-file/
存储桶键是 wip.dm.prod,对象名称是随机 guid 和“.dwg”
Dim objectsAPI As New ObjectsApi()
objectsAPI.Configuration.AccessToken = accessToken
bucketKey = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(bucketKey))
objectName = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(objectName))
Dim objFile As IO.Stream = objectsAPI.GetObject(bucketKey, objectName)
Using fStream As New IO.FileStream(downloadPath, FileMode.CreateNew)
objFile.CopyTo(fStream)
End Using
现在工作,只是不需要在传递给 GetObject 之前对存储桶键和对象名称进行编码
我在使用 Forge .net SDK 从 bim 360 文档中心下载文件时遇到问题。
我正在使用具有以下范围的三足身份验证:-
数据:读取data:writedata:createdata:searchbucket:createbucket:readbucket:updatebucket:delete
它给我以下错误:-
调用 GetObject 时出错:{"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"}
下面的 Get 调用代码,存储桶键和对象名称来自本示例中第 4 步的项目存储位置 https://developer.autodesk.com/en/docs/data/v2/tutorials/download-file/
存储桶键是 wip.dm.prod,对象名称是随机 guid 和“.dwg”
Dim objectsAPI As New ObjectsApi()
objectsAPI.Configuration.AccessToken = accessToken
bucketKey = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(bucketKey))
objectName = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(objectName))
Dim objFile As IO.Stream = objectsAPI.GetObject(bucketKey, objectName)
Using fStream As New IO.FileStream(downloadPath, FileMode.CreateNew)
objFile.CopyTo(fStream)
End Using
现在工作,只是不需要在传递给 GetObject 之前对存储桶键和对象名称进行编码