Design Automation for Revit: 在添加adsk3LeggedToken时出错:访问令牌

huangapple go评论94阅读模式
英文:

Design Automation for Revit: error when adding in adsk3LeggedToken: access token

问题

当将工作项发布到设计自动化时,我一直收到下载项目失败的消息。当我提供参数而不包括 adsk3LeggedToken 时,文件成功下载,然后开始运行脚本。在运行脚本时,我遇到了身份验证问题。根据这篇博客(在底部查看 adsk3LeggedToken 部分),我们需要将参数添加到参数中并提供访问权限。我正在使用 SaveAsCloudModel() API,并且在 Revit API(而不是 DA)中已成功运行捆绑。我正在使用 Postman。

有人知道为什么我会收到下载失败的错误吗?

我的工作项发布:

{
  "activityId": "SAVE_CLOUD_MODEL.SaveModelTestActivity8+current",
  "arguments": {
    "rvtFile": {
      "verb": "get",
      "url": "/* 输入 URL(已测试并可用) */",
      "pathInZip": "/* 工作路径 */"
    },
    "result": {
      "verb": "put",
      "url": "/* 输出 URL(已测试并可用) */"
    },
    "adsk3LeggedToken": "{{ouath3}}"
  }
}

编辑:

我创建了一个2Auth令牌,我以为它是3LeggedOauth。纠正这个问题解决了问题,我能够成功运行自动化。感谢那些回应的人。

英文:

When posting a work item to design automation, I keep getting a failed to download item. When I provide the argument without adsk3LeggedToken, the file successfully downloads then starts the script. When running the script I run into an authentication issue. According to this blog (see adsk3LeggedToken towards bottom), we add in the parameter into the argument and provides access. I'm using the SaveAsCloudModel() API and have run bundle succesfully in Revit API (not DA). I am using postman.

Does anyone know why I'm getting failed download error?

[06/19/2023 13:50:04] T:\Aces\Jobsc520ca0a8984a35b579ad73db46a971\zip_6.zip has been unpacked to folder T:\Aces\Jobsc520ca0a8984a35b579ad73db46a971.
[06/19/2023 13:50:04] Warning: Zip Migration: the input of 'rvtFile' is unzipped to the correct location of 'T:\Aces\Jobsc520ca0a8984a35b579ad73db46a971\unpack_folder_7'.
[06/19/2023 13:50:05] End download phase successfully.
[06/19/2023 13:50:05] Start preparing script and command line parameters.
[06/19/2023 13:50:05] Command line: [ /i "T:\Aces\Jobsc520ca0a8984a35b579ad73db46a971\XXXXX_JLG Revit2021 Starter File_A_detached.rvt" /al "T:\Aces\Applicationsab7ecdf17504804c4d0b05de34b89d4.SAVE_CLOUD_MODEL.SaveModelTest8[1].package"]
[06/19/2023 13:50:05] End preparing script and command line parameters.
[06/19/2023 13:50:05] Start script phase.
[06/19/2023 13:50:05] End script phase.
[06/19/2023 13:50:05] Error: An unexpected error happened during phase CoreEngineExecution of job.
[06/19/2023 13:50:06] Job finished with result FailedEnvironmentSetup
[06/19/2023 13:50:06] Job Status:
{
  "status": "failedDownload",

My work item post:

{
  "activityId": "SAVE_CLOUD_MODEL.SaveModelTestActivity8+current",
  "arguments": {
    "rvtFile": {
      "verb": "get",
      "url": "/* INPUT URL (TESTED AND WORKS) */",
      "pathInZip": "/* WORKING PATH */"
    },
    "result": {
      "verb": "put",
      "url": "/*OUTPUT URL (TESTED AND WORKS)*/"
    },
    "adsk3LeggedToken": "{{ouath3}}"
  }
}

EDIT:

I created a 2Auth Token which I thought was coming through as 3LeggedOauth. Correcting this solved the problem and was able to successfully run the automation. Thank you to those who responded.

答案1

得分: 2

与您输入的URL相关。如果您要求DA从OSS存储桶下载文件,则需要在rvtFile参数的标头中指定访问令牌,而不是adsk3LeggedToken

{
  "activityId": "test.myaddin+dev",
  "arguments": {
    "rvtFile": {
      "verb": "get",
      "url": "https://developer.api.autodesk.com/oss/v2/buckets/mybucket/objects/house.rvt",
      "headers":{
            "Authorization": "Bearer {{Bearer}}",
        	"Content-Type": "application/octet-stream"
      }
    },
    "result": {
      "verb": "put",
      "url": "https://example.org/api/da/models"
    },
    "adsk3LeggedToken": "{{ouath3}}"
  }
}

注意。adsk3LeggedToken 仅用于访问 Revit Cloud Model API。

英文:

It would be related to your input URL. If you ask DA to download the file from OSS bucket, you need to specify the access token in the header of the rvtFile argument, not adsk3LeggedToken.

{
  "activityId": "test.myaddin+dev",
  "arguments": {
    "rvtFile": {
      "verb": "get",
      "url": "https://developer.api.autodesk.com/oss/v2/buckets/mybucket/objects/house.rvt",
      "headers":{
            "Authorization": "Bearer {{Bearer}}",
        	"Content-Type": "application/octet-stream"
      }
    },
    "result": {
      "verb": "put",
      "url": "https://example.org/api/da/models"
    },
    "adsk3LeggedToken": "{{ouath3}}"
  }
}

Note. The adsk3LeggedToken is for accessing Revit Cloud Model API only.

huangapple
  • 本文由 发表于 2023年6月19日 22:00:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76507376.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定