How does the Python Platform SDK handle token expiration automatically? I’m writing a script that polls /api/v2/interaction/search every 5 seconds for 2 hours. Right now I’m manually calling client.refresh_token() in a try/except block when I catch a 401, but it feels messy.
Here is my current setup:
gc = PlatformClient()
gc.set_access_token(my_token)
# ... polling loop ...
I read somewhere that the SDK should intercept 401s and refresh silently. Is that true for the Python version? If so, why am I still getting 401 Unauthorized errors mid-run? The token is a client credentials grant. I want to remove the manual refresh logic if the SDK does it for me.