Handling expired token

873
2
04-26-2021 10:05 PM
WengNg2
New Contributor III

Hi,

I'm currently running into issues with my Python script which uses ArcGIS API for Python to overwrite a feature service. The script is unable to complete publishing an item because the access token I use for authorisation has expired. 

I believe this is happening because one of the commands to publish a service definition file using ArcGIS API for Python exceeds the life of the access token which is 30 minutes. The feature service is rather large so that is understandable . (https://developers.arcgis.com/rest/users-groups-and-items/token.htm)

I have already refreshed the token for every API command I have on the script and it still doesn't work because the single overwrite command takes longer than 30 minutes.

How do we actually handle tokens that expires halfway before the API completes executing?

Regards,

Weng

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor
WengNg2
New Contributor III

It is related but it doesn't solve the issue of what happens when an API command runs for more than 30 mins.

Am I out of luck in this situation? I don't know if I can 'resume' an API action .

 

0 Kudos