Hi,
We have integrated Freshdesk into our system, and it has been working fine. However, today we are facing an intermittent issue where the REST APIs are returning a 429 response: “Too Many Requests.”
Please assist us in addressing this issue.
Hi,
We have integrated Freshdesk into our system, and it has been working fine. However, today we are facing an intermittent issue where the REST APIs are returning a 429 response: “Too Many Requests.”
Please assist us in addressing this issue.
Hi Hosea,
how did you integrate Freshdesk? If you used code, you’ll have to wait for the rate limit by the ammount returned in the rate limit header.
I use Freshservice, but it’s a similar product, for example if you used Nodejs, you could check if the error status is 429, wait for the rate limit and repeat the api call.
async function sample(body) {
try {
await axios.post(`https://${DOMAIN}/api/...`, body,
{
headers: {
'Authorization': AUTH,
'Content-Type': 'application/json'
}
});
} catch (error) {
console.log({status: error.response.status, statusText: error.response.statusText, data: error.response.data});
if(error.response.status == 429) {
await waitForRateLimit(error);
await sample(body);
}
}
}
/**
* Waits for rate limit to refresh
* @param {*} error - Rate limit error from Freshservice API
*/
async function waitForRateLimit(error) {
let retryAfter = +error.response.headers['retry-after'] + 1;
console.info("Rate limit reached, retying after " + retryAfter + " seconds.");
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
}
I hope this helps.
You have reached your rate limit in one or many API limitations.
You can install a new API checker app on fresh to track your 5000 per hour limit.
https://.freshdesk.com/a/admin/marketplace/gallery?route=app&id=194171
Here are is the API rate limit konwledgebase article:
API Rate Limits
This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.