Forums | Users |
Search | Signup | Login

Posting to a nested resource

Subscribe to Posting to a nested resource 3 post(s), 2 voice(s)

 
Avatar PaulO 2 post(s)

Am I doing something incorrectly, or is there a glitch in the API?

curl -i -u 'login:password' -X GET 'http://subdomain.unfuddle.com/api/v1/projects/project_id/tickets/ticket_id/comments'
works, but
curl -i -u 'login:password' -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<comment><body>Test</body></comment' 'http://subdomain.unfuddle.com/api/v1/projects/project_id/tickets/ticket_id/comments'
gives me a 500 error.

Does anyone have an example of posting a comment that works?

 
Avatar Joshua Frappier Administrator 378 post(s)

Paul,

There should not be any problem posting to the comments resource of a ticket to create a comment. However, I do notice that you are missing a closing “>” character at the end of the data you are posting. I can confirm from our logs that this is why your request is failing.

I hope that helps!

 
Avatar PaulO 2 post(s)

Wow. My apologies. Thanks for spotting that.