- Make root REST API URL configurable (e.g. allow to specify an alternative for "
app/rest/<version>" part of the URL). This will allow to direct the client to another version of the API if necessary.
- Ignore (do not error out) item's attributes and sub-items which are unknown to the client. New sub-items are sometimes added to the API without version change and this will ensure the client is not affected by the change.
- Set large (and make them configurable) request timeouts. Some API calls can take minutes, especially on a large server.
- Use HTTP sessions to make consecutive requests (use TCSESSIONID cookie returned from the first authenticated response instead of supplying raw credentials all the time). This saves time on authentication which can be significant for external authentication providers.
- Beware of partial answers when requesting list of items: some requests are paged by default. If you need to process more (e.g. all) items, read and process "nextHref" attribute of the response entity for items collections. If the attribute is present it means there might be more items when queried by the URL provided. Related locator dimensions are "count" (page limit) and "lookupLimit" (depth of search).
- Do not increase the "
lookupLimit" value in the locators without a second thoughthought. Doing so has a the direct effect of of loading the server more and can may require increased amounts of CPU and memory. It is assumed that those increasing the default limit understand the negative consequences for the server performance.
- Do not abuse the ability to execute automated requests for TeamCity API: do not query the API too frequently and restrict the data requested to only that necessary (using due locators and specifying necessary fields). Check the server behaviour behavior under load from your requests. Make sure not to repeat the request frequently if it takes time to process the request.
List of projects:
GET http://teamcity:8111/app/rest/projects/<projectLocator>, where
<projectLocator> can be