无法删除清单文件
我尝试删除清单文件,但不能。有什么帮助吗?我正在用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个范围是可行的。
文件不正确。
https://forge.autodesk .com/en/docs/model-derivative/v2/reference/http/urn-manifest-DELETE/
This scope works out.
document is incorrect.
https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-DELETE/