I am obtaining a Client Credentials access token to call the Query for Conversation Details API. I have set the token expiration to 24 hours, and the token is issued with a 24-hour expiration. However, the token occasionally expires early, sometimes after only 10 hours.
A well-formed application must be able to handle expired tokens and should automatically get a new token when this happens. If you require an investigation for this, please open a case with Care.
Your app should handle this 401 and get a new token at that time, then retry the request with the new token. Making an additional API request to check the status of the token is redundant and will cut your rate limit in half. You'll get the same 401 from any API endpoint whenever your token is invalid.
It would be ok to have a timer in your app that proactively gets a new token a few minutes before the expected expiration, but otherwise doing anything proactive to validate the token isn't necessary and your app should simply be responsive to handling failure conditions.
FYI @tim.smith
Case is raised and we understand the issue. The bottleneck is in our .net method to get token which is causing the issue. Previously it was not asynchronous and when we changed to asynchronous the issue is triggered and when the load is high on the application.