使用 cURL 在 BIM 360 中创建问题(无响应)

Create Issue in BIM 360 using cURL (no response)

我目前正在学习 Create Issues 教程。

我到了最后一步,当我真正 POST 问题时,教程说我应该得到响应,但我没有,命令行只是运行并等待下一个命令,没有回应。

隐藏凭据 这是用于获取访问令牌的代码:

curl -v "https://developer.api.autodesk.com/authentication/v1/authenticate" -X "POST" -H "Content-Type:application/x-www-form-urlencoded" -d "client_id=**********&client_secret=*********&grant_type=client_credentials&scope=data:read data:write"

这是获取 HUB 的代码:

curl -X GET -H "Authorization:Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJJTzY5cVJGYk5kNGlVcWlnS3FnR2xzREdzSk1zQVNBYyIsImV4cCI6MTU0MTA2ODUwNCwic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJxb09SZjBoQlVKNllnY2QwdEF2dGxWem9tV3YyN2JxS0ZMSlVRY1g4dmF2dWN1QXlORkhUUjhGVWJpZ2h4a3JLIn0.ELVPmHsKiK6OH9jqGltyjQuPrfOTH26tS7_i9zbz-Ys" https://developer.api.autodesk.com/project/v1/hubs/b.d3fd0d4b-37cf-4975-9dae-f70******/projects?filter%5Battributes.name%5D=AU%20London"

这是 POST 问题的代码:

curl "https://developer.api.autodesk.com/issues/v1/containers/c5b56b7e-94e8-461b-a4c0-8a05d26a93d0/issues" -d “{"data":{"type":"issues","attributes":{"title":"Tester","description": "Checkifthistestworks.","starting_version":1,"due_date": "2018-02-01T00:00:00.000Z","location_description": "testing","created_at": "2017-6-31T00:00:00Z","assigned_to": "R9WYLGPNCHST"}}}” -X “POST” -H "Content-Type:application/vnd.api+json" -H "Authorization:Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJJTzY5cVJGYk5kNGlVcWlnS3FnR2xzREdzSk1zQVNBYyIsImV4cCI6MTU0MTA2ODUwNCwic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJxb09SZjBoQlVKNllnY2QwdEF2dGxWem9tV3YyN2JxS0ZMSlVRY1g4dmF2dWN1QXlORkhUUjhGVWJpZ2h4a3JLIn0.ELVPmHsKiK6OH9jqGltyjQuPrfOTH26tS7_i9zbz-Ys"

看来您是在使用 2 Legged token 来制造问题,对吧?如果是这样,目前,创建问题需要 3 条腿的令牌。

我也用 Postman 3 Legged 令牌在我这边验证了你的请求,它响应我 403 Forbidden 错误,我只是添加了 "status" 和 "assigned_to_type" 如下图所示,问题已成功创建如下。