To ensure continued availability of system resources for all users in a TeamDynamix environment, we enforce rate-limiting restrictions on many methods in the Web API. This rate-limiting framework enforces a maximum number of calls against an endpoint over a particular period of time.
For each method, the period of time starts with the first request made and resets a specified number of seconds after that point. A rate limit on a particular method will not affect rate limiting on any other method, so that if two actions both have a rate limit of 60 calls every 60 seconds, calling the first action does not affect the availability of the second action.
When a web API method is rate-limited, that will be noted on the documentation for the method.
There are three types of rate-limiting:
When an HTTP request has been rate-limited, the Web API will return an error code of 429 (Too Many Requests).
In addition, in the response for any rate-limited call (regardless of whether it was successful or not), there are three headers that provide useful metadata about the current limits in place:
X-RateLimit-Limit
describes the maximum number of calls in the current measuring period.
X-RateLimit-Remaining
describes the number of calls remaining in the current measuring period.
X-RateLimit-Reset
describes, in RFC 1123 format,
when the current measuring period will end.
In an HTTP response, this might look like:
If you have a web service integration that encounters 429 Too Many Requests errors,
we recommend parsing the X-RateLimit-Reset
header and waiting until the indicated date/time
before continuing to make web service calls. When doing so, we further recommend that you enforce a minimum
waiting period of 5 seconds to mitigate both any potential clock skew and time-zone discrepancies.