I received an unauthorized message response after receiving a response other than unauthorized.
Symptom
- I sent an API GET call, received a response other than unauthorized, then sent the API call again after 20 minutes and received an unauthorized message response.
- The endpoint I am using gets good results and I know I had a valid token. But I still see an unauthorized error after around 20 minutes.
Applies to
- OCLC APIs
Resolution
It seems likely that the initial successful response was due to a valid token, while the later "unauthorized" message could indicate an expired token after the 20 minutes.
Double-check if your code handles automatic token refresh before it expires. When requesting an Access Token, you can include the refresh_token scope in your request.
Additional information
Developer Network Authentication and Authorization: Refresh Tokens
On the API authorization screen, I choose execute but there is no token in the GET response.