![]() ![]() For example, you might want to limit a user to a maximum of 60 requests per minute, and 1000 requests per day. Multiple throttles can also be used if you want to impose both burst throttling rates, and sustained throttling rates. Your API might have a restrictive throttle for unauthenticated requests, and a less restrictive throttle for authenticated requests.Īnother scenario where you might want to use multiple throttles would be if you need to impose different constraints on different parts of the API, due to some services being particularly resource-intensive. Throttles indicate a temporary state, and are used to control the rate of requests that clients can make to an API.Īs with permissions, multiple throttles may be used. No, we don't provide a rate-limit endpoint.Throttling is similar to permissions, in that it determines if a request should be authorized. Is there an endpoint that returns all endpoints for a resource, including the different rate limits and times to retry? How often do you get 429 errors? Does the frequency warrant implementing a throttling process? Frequently asked questions To determine if you need to implement a throttling process, monitor your request errors. For example, you can monitor your request rate and regulate requests when the rate approaches the rate limit. Regulating the request rate can be done statically or dynamically. This is known as a throttling process or a throttling controller. If you regularly approach or bump into the rate limit, consider including a process in your code that regulates the rate of your requests so that they're distributed more evenly over time. Use bulk and batch endpoints such as Update Many Tickets, which lets you update up to 100 tickets with a single API request. Sideloading lets you get two sets of records in a single request. You can avoid unnecessary API calls by sideloading one set of records with another. You can also save relatively static information in a database or serialize it in a file. You can cache data on the server or on the client using DOM storage. Optimize your code to eliminate any unnecessary API calls.įor example, are some requests getting data items that aren't used in your application? Are retrieved data items being put back to your Zendesk product instance with no changes made to them? Here are areas to explore for reducing the number of requests: Make sure you make only the requests that you need. retry - after ) retry ( url ) Reducing the number of API requests ![]() status equals 429 : alert ( 'Rate limited. The following pseudo-code shows a simple way to catch rate-limit errors: Your code should stop making additional API requests until enough time has passed to retry. The Retry-After header specifies that you can retry the API call in 93 seconds. The 429 status code means too many requests. The response contains the following key information: com left intact * Closing connection # 0 * SSLv3, TLS alert, Client hello ( 1 ) : Rate limit for ticket updates exceeded, please wait before updating this ticket again ![]() com < X - Zendesk - User - Id : 338231444 < X - Zendesk - Request - Id : c773675d81590abad33i < * Connection # 0 to host SUBDOMAIN. ![]() 2 < Date : Mon, 00 : 18 : 27 GMT < Content - Type : text / html charset = utf - 8 < Content - Length : 85 < Connection : keep - alive < Status : 429 < Cache - Control : no - cache < X - Zendesk - API - Version : v2 < Retry - After : 93 < X - Zendesk - Origin - Server : ** **. ![]()
0 Comments
Leave a Reply. |