OAuth User Authentication

oauth#test - Add the access_token as header to any request

  • Add the http header Authorization to every request.
  • If you experience troubles make sure you are sending the application/json headers.
  • If you still run into troubles - contact us!

Request

Route

POST /v2/api/graphql

Headers

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

Body

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

Response

Status

200 OK

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Rate-Limit-Limit: 900
X-Rate-Limit-Remaining: 900
X-Rate-Limit-Reset: 900
ETag: "5e5a5c086082754f885464d04fc11842"
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 3672

Body

{
  "data": {
    "viewer": {
      "user": {
        "username": "testuser"
      }
    }
  }
}