I'm currently constructing an API that will query Enterprise REST services using an access token. The end user is asked to provide the access token when querying the API.
The api is very long-running, and we have discovered that the token times out before data extraction is complete. The customer is reluctant to increase token expiry time. Can someone please provide some suggestions on how to deal with token expiration?
typically ArcGIS services reply with error 498 when a token has expired (there are other possible reasons). when you handle that 498 response your workflow should be to use your token generation workflow to get a new refreshed token.
see these articles for more information: