Hello Dojo,
We have a User-Defined API running in a staging environment that is operational and functional. However, we’ve noticed something odd: sometimes the very first call after an idle period returns a timeout. If we repeat the same call right after, we get a response indicating that the first request was actually executed successfully. Interestingly, if we make a new call with different data, there’s no timeout — it only ever happens on the very first request after being idle.
Has anyone else experienced something similar, or do you have any ideas about what might be causing this behavior?


Hello, I'd like to know if there's way to change the timeout value for an API Request as I'm working on an API that I can expect will take longer than 90 seconds

Hi Bautista, yes there is, it's a setting in the UserDefinableApiEndpoint DxM, documented here: https://docs.dataminer.services/dataminer/Functions/User-Defined_APIs/UD_APIs_UserDefinableApiEndpoint.html#configuring-the-dxm
Apart from this setting, you also need to make sure the time-out is updated in IIS, how to do this is documented on the same page:
https://docs.dataminer.services/dataminer/Functions/User-Defined_APIs/UD_APIs_UserDefinableApiEndpoint.html#changing-the-timeout
I do want to emphasize that using long requests like this is not good practice. If possible, try to keep your API requests quick. One way to do this is making your API start an async subscript in the background for long-running actions, you can then use a different API endpoint to poll the status of the action.
 
						
Hi Yohan, can you give some more info on what your API script does? And can you tell us how long it takes for your API request to execute in normal circumstances? The default timeout for a User-Defined API trigger is 90 seconds. If the script is still running by then, a timeout error will be returned, but the script will remain running in the background, this is expected behavior. After a DMA restart, it's normal that the first request is a little slower, but 90+ seconds seems like a lot.