OAuth 2

POST /oauth/v2/token

Simple Access

Issues an access token to access the resources of a user. The access token is valid for 25 hours. The "client_credentials", “authorization_code” 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

HTTP headers

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_type
    string

    The OAuth 2 grant type requested.

    Possible values: client_credentials, authorization_code, refresh_token

  • client_id
    string

    The client ID of the application.

    Example: "s6BhdRkqt3"

  • client_secret
    string

    The client secret of the application.

    Example: "7Fjfp0ZBr1KtDRbnfVdmIw"

  • scope
    string|null

    Optional

    The scopes that the token has access to.

Response

[200] An access token is issued.

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

    The requested access token.

    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|null

    The scopes that the token has access to.