Get Token

Obtain an authorization token from the OAUTH server.

EndPoint

https://www.pollstar.com/api/v2/token

Request Parameters

You must HTTP POST the following parameters in the request to obtain a valid token.

Request Headers

Content-Type
application/x-www-form-urlencoded

Request Body

grant_type
client_credentials
client_id
Your client ID, as specified in the API configuration panel on Pollstar.com.
client_secret
Your client secret, as specified in the API configuration panel on Pollstar.com.

Return Codes

On success, the endpoint will return a “200 OK” response, along with the token in the following format:

{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1bmlxdWVfbmFtZSI6ImQzMWNhYjlkODAzZTRlYmFhMzZjNDg4NTM3NmQyYTE4Iiwic3ViIjoiZDMxY2FiOWQ4MDNlNGViYWEzNmM0ODg1Mzc2ZDJhMTgiLCJyb2xlIjpbIkdldEFydGlzdERldGFpbCIsIkdldEFydGlzdFJvdXRlQm9vayJdLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjI0MzEiLCJhdWQiOiJkMzFjYWI5ZDgwM2U0ZWJhYTM2YzQ4ODUzNzZkMmExOCIsImV4cCI6MTUyMzkwNTE4MywibmJmIjoxNTIzOTAzMzgzfQ.XeDShki3VZAzag4TLHahnGCrIkF1ymulP6dRV4YwsyU",
    "token_type": "bearer",
    "expires_in": 1799
}

Error Codes

400
Bad Request. One or more of the supplied parameters are invalid.
403
Unauthorized.

Additionally, you will receive a short JSON message containing a description of the error. For example:

{
    "error": "client_secret cannot be null"
}

 

%d bloggers like this: