Search code examples
curlautodesk-forgeautodeskautodesk-bim360

Create Issue in BIM 360 using cURL (no response)


I am currently following the Create Issues tutorial.

I got to the last step and when I actually POST the issue, the tutorial says I should get a response, but I don't, the command line just runs and waits for the next command, no response.

Credentials hidden Here is the code used to get the Access Token:

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"

Here is the code to get the 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"

Here is the code to POST the issue:

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"

Solution

  • It seems you are using 2 Legged token to create the issue, right? If so, currently, creating an issue requires 3 Legged token.

    I also verified your request on my side with Postman 3 Legged token, it respond to me 403 Forbidden error, and I just added "status" and "assigned_to_type" as shown in the following picture, the issue was successfully created as follow.

    enter image description here