'Valid access tokens keep getting rejected by API

We are using a refresh token to generate access tokens for an automated process to get data from the LinkedIn Marketing API.

It works for a while, then the Page Statistics API returns this message:

{"serviceErrorCode": 65601, "message": "The token used in the request has been revoked by the user", "status": 401}

However, inspecting the refresh token and the access token generated (and rejected by the API) reveals that both are in fact still active. Furthermore, after a while, the API starts working again for a little bit and then goes back to the above error unexpectedly.

I contacted LinkedIn customer support which redirected me to ask my question here: why is the API responding with an expired token message when that is clearly not the case?

Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source