我正在学习 Autodesk Forge API。通过一个简单的 C# 应用程序,我能够使用 Forge API 进行身份验证。
var responseString = await
"https://developer.api.autodesk.com/authentication/v1/authenticate"
.PostUrlEncodedAsync(new
{
client_id = Client_ID.Text,
client_secret = Client_Secret.Text,
grant_type = "client_credentials",
scope = "data:read data:write bucket:create bucket:read"
})
.ReceiveJson();
虽然我已明确指定 bucket:read 范围 bucket:read,但进一步调用以检查是否存在 bucket 失败并出现错误:-
Http code 403 (Forbidden) with the message "Only the bucket creator is allowed to access this API"
当我尝试创建另一个具有相同名称的存储桶时,它失败了:-
Http Code 409 (Conflict) with the message "Bucket already exists"
有人可以帮我解决这里遗漏的问题吗?
最佳答案
是的,问题在于您的存储桶 key 在所有应用程序和区域中应该是全局唯一的。您可以在 https://developer.autodesk.com/en/docs/data/v2/reference/http/buckets-POST/ 查看文档对于细节,特别是对于Bucket Key的描述。
关于c# - 使用 Autodesk Forge API 验证和创建存储桶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46138312/