7

I'm suddenly getting this error when making API calls to my StackOverflow Team API:

{
    "error_id": 403,
    "error_message": "`key` is not valid for passed `access_token`, token not found.",
    "error_name": "access_denied"
}

This is the GET request I'm trying to make:

https://api.stackexchange.com/2.2/comments?site=stackoverflow&team=stackoverflow.com/c/<team-name>&filter=total&key=<team-key>

With the following header for authentication:

X-API-Access-Token: <api-token>

I've obtained my tokens with a no-expiry scope, and they were working last week, but requests to the API are now returning the error above.

What could be the issue?

5
  • Possible duplicate of Stack Overflow app not loading content Mar 4, 2019 at 21:04
  • Possibly related: meta.stackexchange.com/questions/324691/… Mar 4, 2019 at 21:06
  • 1
    Sorry, but I don't find how those questions are relevant to using the SO API. I stated in my question that I have requested new tokens to send calls to the API, yet they don't work Mar 4, 2019 at 21:09
  • @CarlosMartinez oh it wasn't clear from your question. you said it was no-expiry which to me was that you had it stored. Mar 4, 2019 at 21:12
  • Sorry if I wasn't clear, I was using a token with no expiration to access the Teams JSON API which suddenly stopped working. I've created new access tokens and yet they all return the same error message. I rechecked that the "key" and "client_id" parameters have the correct values for my application. Mar 4, 2019 at 21:16

1 Answer 1

9

Teams API access still works fine for me. Something not shown in the question is the problem.

  1. Don't use total for the filter. That filter omits crucial wrapper and error properties and may be masking the original problem.
  2. You don't mention Client Secret so verify that you are using implicit OAuth.
  3. Go ahead and reset the Client Secret, on your app's configuration page, regardless.
  4. Then get a fresh access access_token and try again.

You don't show how you got your access token. Edit the question to have a complete MCVE.

1
  • 2
    I disabled/enabled the option: Enable Client Side OAuth Flow and then requested another token and the problem is solved. Weird. Mar 5, 2019 at 15:56

Not the answer you're looking for? Browse other questions tagged .