OAuth User Authentication

unauthorized_oauth: oauth#test - Invalid access_tokens will lead to error messages

Request

Route

POST /v2/api/graphql

Headers

Accept: application/json
Content-Type: application/json
Host: api.producthunt.com

Body

{
  "query": "query { viewer { user { username } } }"
}

Response

Status

401 Unauthorized

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
WWW-Authenticate: Bearer realm="ProductHuntOauth2", error="invalid_token", error_description="The access token is invalid"
Content-Type: application/json; charset=utf-8
Content-Length: 267

Body

{
  "data": null,
  "errors": [
    {
      "error": "invalid_oauth_token",
      "error_description": "Please supply a valid access token. Refer to our api documentation about how to authorize an api request. Please also make sure you require the correct scopes. Eg 'private public' to access information on behalf of a user."
    }
  ]
}