Month: June 2013
The TeamCity REST API looks to be quite popular (I’ve not knowingly used it). I’ve had a request to add REST API support to tcWebHooks. I’ve not written a public webservices API before. Only really web APIs for services that I control both ends of.
Note: This is not a commitment to build it, more a place to put my thoughts on whether it’s worthwhile or not and how it might work.
I see the four basic requirements.
- Is there anything else needed? Perhaps test?
I think there are three ways it could be accomplished.
- Write it myself and probably get it wrong.
- Write it myself with a lot input from the users. Who is willing to commit to helping me spec it and test it?
- Write a Java API and let someone else write the webservice parts.
The stuff I’ve done before was sending and receiving JSON, and only used POST and GET. Do I need to worry about the whole strict PUT, DELETE etc verbs?
What should the request payload look like? XML? JSON? Name Value Pairs?
What should the response payload look like?
Any good examples? I presume basing it on the existing TeamCity REST API would be the path of least surprise for users. I’ve not used it so don’t have a lot of experience on how it works.
TeamCity 8 has just been released and the UI in tcWebhooks was not working correctly due to the new Internal/External Project naming changes.
Basically, the page was being redirected by Teamcity whenever you went to the edit webhooks screen. My JSP controller was looking for “projectId=project01” in the URL so it was never loading the settings into the UI.
Existing settings appeared to be fine, but editing webhooks required hacking the XML files on the server. This new release fixes that, and adds the projectExternalId value to the webhook payload.
Other than that. Webhooks appear to be firing correctly on my test server running TC8. If you find anything different, please post a comment below or on the Bugs page.
NOTE: Due to changes in the TeamCity API, this version will only work on version 8.0 and above of TeamCity.
If you’re keen to try it out, you can download it from here: tcWebHooksPlugin-0.8.29.142.zip