> ## Documentation Index
> Fetch the complete documentation index at: https://help.teable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get plugin token

> Get a token



## OpenAPI

````yaml /swagger.json get /plugin/{pluginId}/token
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
paths:
  /plugin/{pluginId}/token:
    get:
      tags:
        - plugin
      description: Get a token
      parameters:
        - schema:
            type: string
          required: true
          name: pluginId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                baseId:
                  type: string
                secret:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                authCode:
                  type: string
              required:
                - baseId
                - secret
                - scopes
                - authCode
      responses:
        '200':
          description: Returns token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                  refreshToken:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                  expiresIn:
                    type: number
                  refreshExpiresIn:
                    type: number
                required:
                  - accessToken
                  - refreshToken
                  - scopes
                  - expiresIn
                  - refreshExpiresIn
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request GET \
              --url https://app.teable.ai/api/plugin/%7BpluginId%7D/token \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"baseId":"string","secret":"string","scopes":["string"],"authCode":"string"}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/plugin/%7BpluginId%7D/token';
            const options = {
              method: 'GET',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"baseId":"string","secret":"string","scopes":["string"],"authCode":"string"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: >-
            const http = require('https');


            const options = {
              method: 'GET',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/plugin/%7BpluginId%7D/token',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({baseId: 'string', secret: 'string',
            scopes: ['string'], authCode: 'string'}));

            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"baseId\":\"string\",\"secret\":\"string\",\"scopes\":[\"string\"],\"authCode\":\"string\"}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("GET", "/api/plugin/%7BpluginId%7D/token", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````