API Authentication
Authenticate your API requests with the Tapjoy Offerwall API to manage campaign data and performance.
Read time 1 minuteLast updated 3 hours ago
Requesting Access
Requests are authenticated using a standard two-legged OAuth2 flow: anaccess_token
access_token

POST /v1/oauth2/token Host: api.tapjoy.com Authorization: Basic <API Key> Accept: application/json
curl -H "Authorization: Basic <API Key>" -X POST https://api.tapjoy.com/v1/oauth2/token
Successful Responserequire 'json' require 'net/https' access_token = "<OAuth Token>" query = <<~END query { user { firstName } } END json = JSON.dump({query: query}) http = Net::HTTP.new('api.tapjoy.com', 443) http.use_ssl = true request = Net::HTTP::Post.new('/graphql') request['Authorization'] = "Bearer #{access_token}" request.body = json response = http.request(request) result = JSON.parse(response.body) data = result['data'] errors = result['errors']
Unsuccessful Responsestatus 200 { “access_token”: “token_string”, “token_type”: “bearer”, “expires_in”: 3600, “refresh_token”: null }
status 401 { “error”: “Unauthorized” }
Using the Access Token
When you have anaccess_token
access_token
access_token
Missing/Invalid Token ResponsePOST /v4/audiences Host: api.tapjoy.com Authorization: Bearer <token_string> Accept: application/json
status 401 { “error”: “Unauthorized” }