When a user registered, our system will generate 8 api calls to update the same user’s profile at the same time
The api used is /crm/sales/api/contacts/id.
Here is how our code is when making the requests:
const requestData = {
contact: {
custom_field:{
cf_something: "sth"
}
}
};
axios.put(`${freshworksUri}/crm/sales/api/contacts/${userId}`, requestData, {
headers: {
Authorization: `Token token=${process.env.API_KEY}`,
'Content-Type': 'application/json'
}
});
The above code is triggered by events, so multiple calls to the freshworks crm api can happen at that same time.
We found that among these 8 calls, there are always one or two calls cannot be handled and the error is
{
"message": "Request failed with status code 400",
"name": "Error",
"stack": "Error: Request failed with status code 400...."
}
It seems it is not because of our request data or header, because the calls sometimes work, and sometimes don’t.
I wonder if it is because there is a limit of number of calls at the same time??