无法删除清单文件

发布于 2025-01-09 13:51:44 字数 1359 浏览 0 评论 0原文

我尝试删除清单文件,但不能。有什么帮助吗?我正在用 Ruby 编码。

access_token = AutodeskForge.get_access_token(oauth_scope:'data:write data:read')
response = RestClient.delete(
  "#{API_URL}/modelderivative/v2/designdata/#{base_64_urn}/manifest",
  { Authorization: "Bearer #{access_token}" }
)

=> "404 Not Found"

"x-ads-troubleshooting"=>["无法对输入的瓮进行授权。要么该对象不存在,要么您无权查看该对象。"]

但是,我可以得到清单的详细信息

response = HTTParty.get("#{API_URL}/modelderivative/v2/designdata/#{urn}/manifest", headers: headers)

=>获取清单详细信息

我阅读了此文档。 https://forge.autodesk .com/en/docs/model-derivative/v2/reference/http/urn-manifest-DELETE/ 正如所写,我在范围内设置了“data:write data:read”,

这是一个获取 access_token 的函数

  def self.get_access_token(oauth_scope:)
    options = {
      body: { 
        client_id: Rails.application.credentials.autodesk[:forge][:client_id],
        client_secret: Rails.application.credentials.autodesk[:forge][:client_secret],
        grant_type: 'client_credentials',
        scope: oauth_scope
      }
    }
    response = HTTParty.post("#{API_URL}/authentication/v1/authenticate", options)
    JSON.parse(response.body)['access_token']
  end

I tried to delete manifest file, but can't. Any help? I'm coding in Ruby.

access_token = AutodeskForge.get_access_token(oauth_scope:'data:write data:read')
response = RestClient.delete(
  "#{API_URL}/modelderivative/v2/designdata/#{base_64_urn}/manifest",
  { Authorization: "Bearer #{access_token}" }
)

=> "404 Not Found"

"x-ads-troubleshooting"=>["Fail to authorize the input urn. Either the object doesn't exist or you don't have permission to view the object."]

However, I can get detail of a manifest

response = HTTParty.get("#{API_URL}/modelderivative/v2/designdata/#{urn}/manifest", headers: headers)

=> Get the manifest detail

I read this ducoment.
https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-DELETE/
As it is written, I set "data:write data:read" in scope

this is a function to get access_token

  def self.get_access_token(oauth_scope:)
    options = {
      body: { 
        client_id: Rails.application.credentials.autodesk[:forge][:client_id],
        client_secret: Rails.application.credentials.autodesk[:forge][:client_secret],
        grant_type: 'client_credentials',
        scope: oauth_scope
      }
    }
    response = HTTParty.post("#{API_URL}/authentication/v1/authenticate", options)
    JSON.parse(response.body)['access_token']
  end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖不如嘢 2025-01-16 13:51:44

这个范围是可行的。

data:write data:read viewables:read

文件不正确。
https://forge.autodesk .com/en/docs/model-derivative/v2/reference/http/urn-manifest-DELETE/

This scope works out.

data:write data:read viewables:read

document is incorrect.
https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-DELETE/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文