I have a problem, when consulting an API on certain occasions the API fails throwing this error 421, but it is intermittent since on other occasions it works correctly, can you help me understand what the solution to this would be in kore
Hello Carlos,
Welcome to Kore.ai Community.
To address the Error 421 issue with an external API in Kore.ai, here are some steps and considerations to resolve it based on common patterns seen with such errors:
Possible Causes and Solutions
- Intermittent API Failures:
- Cause:
API endpoints may intermittently fail due to server-side issues, rate limiting, or network instability. - Solution:
Check the API server logs or documentation for rate limits. Ensure your API requests comply with these limits and retry with exponential backoff for failed requests.
- IP Whitelisting:
- Cause:
External APIs often require IP whitelisting for security. - Solution:
Ensure the Kore.ai platform’s outgoing IPs are whitelisted for the external API. Refer to the list of IPs for your region in Kore.ai’s documentation to configure this correctly.
- Incorrect or Missing Headers:
- Cause:
Missing required headers likeAuthorization
, incorrect API keys, or token issues can cause a ResolverError. - Solution:
Verify the headers, includingContent-Type
andAuthorization
. Check if your JWT token is correctly generated and has the necessary permissions
- Endpoint-Specific Issues:
- Cause:
Certain endpoints may have specific requirements or be unstable. - Solution:
Test alternative endpoints, as was successful in a similar case. This can help narrow down if the issue is specific to one endpoint.
- Timeout or Network Configuration:
- Cause:
Timeout or misconfigured network settings between Kore.ai and the API. - Solution:
Increase the timeout settings in the service node, if configurable, and verify network connectivity.
- Debugging and Logs:
- Use koreDebugger.log() in the script node to capture and analyze the data passed in requests.
- Check response codes in the API logs for 4xx or 5xx errors to pinpoint issues.
Further Assistance
If these steps do not resolve the problem, consider sharing:
- The specific endpoint URL and payload.
- Headers used in the request.
- Logs or error codes returned during the API calls.
Hope this helps.
Thank you,
Srujan Madderla
Kore.ai Community Team