PeerTube · Example Payload

Getoauthtoken

With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.

Session

Getoauthtoken is an example object payload from PeerTube, with 9 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

operationIdmethodpathsummarydescriptiontagsparametersrequestBodyresponses

Example Payload

Raw ↑
{
  "operationId": "getOAuthToken",
  "method": "POST",
  "path": "/api/v1/users/token",
  "summary": "Login",
  "description": "With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.",
  "tags": [
    "Session"
  ],
  "parameters": [
    {
      "name": "x-peertube-otp",
      "in": "header",
      "required": false,
      "description": "If the user enabled two factor authentication, you need to provide the OTP code in this header",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "contentType": "application/x-www-form-urlencoded",
    "schema": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/OAuthToken-password"
        },
        {
          "$ref": "#/components/schemas/OAuthToken-refresh_token"
        }
      ],
      "discriminator": {
        "propertyName": "grant_type",
        "mapping": {
          "password": "#/components/schemas/OAuthToken-password",
          "refresh_token": "#/components/schemas/OAuthToken-refresh_token"
        }
      }
    },
    "example": {}
  },
  "responses": {
    "200": {
      "description": "successful operation",
      "examples": {}
    },
    "400": {
      "description": "Disambiguate via `code`:\n- `invalid_client` for an unmatched `client_id`\n- `invalid_grant` for unmatched credentials\n",
      "examples": {}
    },
    "401": {
      "description": "Disambiguate via `code`:\n- default value for a regular authentication failure\n- `invalid_token` for an expired token\n- `missing_two_factor` if two factor header is missing\n",
      "examples": {}
    }
  }
}