1. How can I prevent element timeout when receiving a 400 error from the API, and instead display the error message in a table?
The API I’m using allows sending multiple values in a single request. If any one of those values is invalid, the API responds with a 400 Bad Request
, along with a descriptive error message in the response body (In Postman).
While the API behavior is expected in Postman, my element goes into a timeout whenever this happens.
-
Is there a way in DataMiner to handle the 400 response gracefully and avoid the timeout?
-
Can I extract the error message from the response and display it in a table column (e.g., as a per-row error field), instead of letting the element fail?
2. How can I avoid hitting the 429 "Too Many Requests" limit with an API that allows only 1,000 calls per month?
I occasionally receive 429 Too Many Requests
errors, and I’d like to avoid hitting this monthly limit. Are there techniques in DataMiner to limit the number of API calls ?
Thanks,
ignoreTimeout attribute | DataMiner Docs
You can disable timeout on specific API calls in you protocol by setting ignoreTimeout="true" in the connection element. To display the error in a table, you could make an error Json class and deserialize the response the API returns to fill out your column. In your QAction where you process the response, if your status code is invalid, you would process an error message instead.
For your "Too Many Requests" error, you could store the number of requests you can make in a parameter and add a condition to your groups to make sure you are not going above your limit.
Just to add, It goes to timeout also when fetching the value then returns to normal state. How can I avoid this?