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

时间:2018-11-01 11:04:15

标签: curl autodesk-forge autodesk autodesk-bim360

我目前正在关注Create Issues教程。

我走到了最后一步,当我实际发布问题时,教程说我应该得到响应,但是我没有,命令行只是运行并等待下一条命令,没有响应。

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

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"

以下是发布问题的代码:

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"

1 个答案:

答案 0 :(得分:1)

似乎您正在使用2 Legged令牌创建问题,对不对?如果是这样,当前,创建问题需要3 Legged令牌。

我还用Postman 3 Legged令牌在我这一边验证了您的请求,它响应了我403 Forbidden错误,并且我刚刚添加了“状态”和“ assigned_to_type”,如下图所示,该问题已成功创建,如下所示。

enter image description here