OAuth 2

POST /oauth/v2/token

Issues an access token to access the ressources of an user. The access token is valid 25 hours. For the moment, only the "client_credentials" grant type is 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 doesn't have any query parameters.

Request Body

Example
grant_type=client_credentials&client_id=s6BhdRkqt3&client_secret=7Fjfp0ZBr1KtDRbnfVdmIw
Structure
  • grant_type
    string

    The OAuth 2 grant type requested. Only "client_credentials" is supported.

    Possible values: client_credentials

  • client_id
    string

    The client_id of the application.

    Example: "s6BhdRkqt3"

  • client_secret
    string

    The client_secret of the application.

    Example: "7Fjfp0ZBr1KtDRbnfVdmIw"

Response

[200] An access token is issued.

Example
{
    "access_token": "TUzZDcxYWQxZmYwNTU0ZTg2M2MyMDk5ZmUyZWI2ZQ",
    "expires_in": 90000,
    "token_type": "bearer",
    "scope": null
}
Structure (object)
  • access_token
    string

    The access token requested.

    Example: "TUzZDcxYWQxZmYwNTU0ZTg2M2MyMDk5ZmUyZWI2ZQ"

  • expires_in
    integer

    The number of seconds before the access token expires.

    Example: 90000

  • token_type
    string

    The type of access token returned. For the moment, limited to "bearer".

    Possible values: bearer

  • scope
    string

    The scopes that the token has access. For the moment, no scopes are used.