I want to GET the user details based on email. So I am trying to use this Okta API https://developer.okta.com/docs/reference/api/users/#get-user-with-login . I am able to use it via Postman and curl. But via google-apps-script I get errorCode":"E0000005","errorSummary":"Invalid session". I am not sure on how I can clear the session or cookie in google-apps-script so that it starts working. I am certain that I am using the proper token and end point.
The "Invalid session" error usually occurs when the API token you are using doesn't have sufficient permissions. Check to see if you are using the same API key/token in postman as in the script.