Oauth2 API › OAuth 2
POST /oauth/v2/token
Issues an access token to access the resources of a user. The access token is valid for 25 hours. The "client_credentials" and “refresh_token” grant types are currently supported. The client makes a request by adding the following parameters using the "application/x-www-form-urlencoded" content type. The request-body is using parameters, but the HTTP response is using the "application/json" media type.
Resource URL
https://api.toornament.com/oauth/v2/token
Query Parameters
This endpoint does not have any query parameters.
Request Body
User application credentials.
Example
grant_type=client_credentials&client_id=s6BhdRkqt3&client_secret=7Fjfp0ZBr1KtDRbnfVdmIw
Structure
- grant_typestring
The OAuth 2 grant type requested.
Possible values: client_credentials, refresh_token
- client_idstring
The client ID of the application.
Example: "s6BhdRkqt3"
- client_secretstring
The client secret of the application.
Example: "7Fjfp0ZBr1KtDRbnfVdmIw"
- scopestring|null
Optional
The scopes that the token has access to.
Response
[200] An access token is issued.
Example
{ "access_token": "TUzZDcxYWQxZmYNTU.0ZTg2M2My...", "expires_in": 90000, "token_type": "bearer", "scope": null, "refresh_token": "OWIwmug9m_kJyXDqgFP3ufBHdpp..." }
Structure (object)
- access_tokenstring
The requested access token.
Example: "TUzZDcxYWQxZmYNTU.0ZTg2M2My..."
- expires_ininteger
The number of seconds before the access token expires.
Example: 90000
- token_typestring
The type of access token returned. For the moment, limited to "bearer".
Possible values: bearer
- scopestring|null
The scopes that the token has access to.
- refresh_tokenstring
Optional
The requested refresh token.
Example: "OWIwmug9m_kJyXDqgFP3ufBHdpp..."