I have a custom API which im calling from my GQI to get data. The GQI data is then rendered in grid component LCA. I refresh the grid every 10 seconds, and I cache API response in my GQI for 30 seconds. So for every 30 secs i call my custom API to get data.
Sometimes the API client call throws 401 error even though im passing correct token. this error is thrown once for every 4 API call.
I tried to get data from same API through postman, there also i get same 401 error for once in every 4 calls.
what could be the issue here and how to resolve this?
By custom API I assume you mean a 3rd party API and not a user defined API within Dataminer. As you are getting the same error in postman the problem most likely lies at the API endpoint. I can think of two possible reasons;
- Rate limiting by the API. (Slow down the rate of requests to see if it makes a difference)
- Load balancing at the endpoint and one of the servers the requests gets to invalidates the token.
These are of course wild guesses but I think the focus of your investigation should be on the endpoint serving your requests.

In that case your first port of call should be the Data Aggregator (DxM) logs which you can access via System Center > Logging or C:\ProgramData\Skyline Communications\DataMiner DataAggregator\Logs.
Can you check and see if the logs shed more light when you get the authentication error.
I have user defined API in dataminer.