【问题标题】:Design Automation For Revit: Unable to Add AppBundle Zip FileRevit 的设计自动化:无法添加 AppBundle Zip 文件
【发布时间】:2019-03-11 12:12:32
【问题描述】:

我正在通过以下链接关注 Revit 的设计自动化 APIv3 教程:Forge Tutorial。在卡住之前,我使用邮递员完成了任务 4/步骤 3。我收到的错误消息如下:

'根据策略无效:策略条件失败:["eq", "$key", "apps/ForgeTest/DeleteWallsApp3/1"]'

我正在使用从发布请求返回的 formData 创建一个新的应用程序包。可能是什么问题?

【问题讨论】:

    标签: autodesk-forge


    【解决方案1】:

    在对POST appbundles 的端点响应中,有一个key 属性(用于临时访问我们存储桶的访问密钥)在将捆绑包上传到您的AWS S3 签名URL 时需要进入您的帖子字段:

    {
        "uploadParameters": {
            "endpointURL": "https://dasprod-store.s3.amazonaws.com",
            "formData": {
                "key": "apps/ForgeTest/DeleteWallsApp3/1", //find your access key here
    ...
    

    通过POST appbundles/:id/versions 创建另一个包或当前包的新版本,并确保在您的 cURL 命令中上传包的键匹配:

    curl https://bucketname.s3.amazonaws.com/
    -F key = apps/ForgeTest/DeleteWallsApp3/1 // access key goes here
    -F content-type = application/octet-stream
    -F policy = eyJleHBpcmF0aW9uIjoiMjAxOC0wNi0yMVQxMzo...(trimmed)
    -F x-amz-signature = 800e52d73579387757e1c1cd88762...(trimmed)
    -F x-amz-credential = AKIAIOSFODNN7EXAMPLE/20180621/us-west-2/s3/aws4_request/
    -F x-amz-algorithm = AWS4-HMAC-SHA256
    -F x-amz-date = 20180621T091656Z
    -F file=@E:myfile.zip
    

    有关 AWS 预签名 URL(将 appbundle 上传到 Forge 的 AWS 云存储的 URL)如何工作的详细信息,请参阅 here

    【讨论】:

    • 我想我的钥匙一定是搞错了。有效!需要注意的一点是“success_action_status”、“success_action_redirect”和“x-amz-server-side-encryption”字段也是必需的。谢谢。
    猜你喜欢
    • 2019-12-02
    • 2021-06-29
    • 1970-01-01
    • 2020-08-07
    • 2021-05-10
    • 1970-01-01
    • 2021-09-03
    • 2020-04-22
    • 2019-07-22
    相关资源
    最近更新 更多