Troubleshooting · Developer docs

Troubleshooting

Grouped by symptom, never by module, because the person with the problem does not know which module has it. One hundred questions across ten pages, each answered with the causes in the order they usually turn out to be true.

Answer API requests

My OAuth token stopped working after four hours: 403 "Token doesn't exist or is not valid"

An access token lasts four hours (expires_in 14400), and an expired one answers 403, not 401. Exchange the refresh token at /oauth/token for a new one, with client_id and, for a server, client_secret in the body; then send the request again.

If the refresh itself fails with 400 invalid_grant, the refresh token is no longer good: it expires sixty days after it was issued, and it can be exchanged fifty times. On the fiftieth exchange the answer carries a new refresh token and the old one stops working, so a client that kept only the first one is locked out after fifty refreshes. Store the refresh token from every answer. When it has expired, someone has to sign in as the integration's user again.

Shell
curl https://www.example.com/oauth/token \
  -d grant_type=refresh_token \
  -d refresh_token=THE_REFRESH_TOKEN \
  -d client_id=YOUR_CLIENT_ID \
  -d client_secret=YOUR_CLIENT_SECRET

# 200 {"token_type": "Bearer", "expires_in": 14400, "access_token": "CDNA-A-…", "refresh_token": "…"}
#      store both: the refresh_token may be a new one

A token module that does this is in Connect a server integration with OAuth and keep its token fresh; the flow is in Authentication and authorisation.

In the API reference: Refresh an access token.

More in API requests

  1. GraphQL answers 500 "Currently, only Query GraphQL requests are supported by this API"
  2. My form submission through the API answered 207
  3. One visitor's form shows up twice among the submissions
  4. Showing an error when a JS-model submission is rejected
  5. A conditional field never appears, or never hides

Was this page helpful?

Your answer goes to the docs team.