Files
few-line-engine/out/js/docs/APITokensApi.md

3.5 KiB

LowCodeEngineApi.APITokensApi

All URIs are relative to http://localhost:3000

Method HTTP request Description
apiTokenGeneratePost POST /api/token/generate Generate API token
apiTokenRevokeTokenDelete DELETE /api/token/revoke/{token} Revoke API token

apiTokenGeneratePost

Token apiTokenGeneratePost(apiTokenGeneratePostRequest)

Generate API token

Generate a new API token for a project

Example

import LowCodeEngineApi from 'low_code_engine_api';
let defaultClient = LowCodeEngineApi.ApiClient.instance;
// Configure API key authorization: AdminAuth
let AdminAuth = defaultClient.authentications['AdminAuth'];
AdminAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AdminAuth.apiKeyPrefix = 'Token';
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new LowCodeEngineApi.APITokensApi();
let apiTokenGeneratePostRequest = new LowCodeEngineApi.ApiTokenGeneratePostRequest(); // ApiTokenGeneratePostRequest | 
apiInstance.apiTokenGeneratePost(apiTokenGeneratePostRequest, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
apiTokenGeneratePostRequest ApiTokenGeneratePostRequest

Return type

Token

Authorization

AdminAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

apiTokenRevokeTokenDelete

apiTokenRevokeTokenDelete(token)

Revoke API token

Revoke an existing API token

Example

import LowCodeEngineApi from 'low_code_engine_api';
let defaultClient = LowCodeEngineApi.ApiClient.instance;
// Configure API key authorization: AdminAuth
let AdminAuth = defaultClient.authentications['AdminAuth'];
AdminAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AdminAuth.apiKeyPrefix = 'Token';
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new LowCodeEngineApi.APITokensApi();
let token = "token_example"; // String | Token to revoke
apiInstance.apiTokenRevokeTokenDelete(token, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
token String Token to revoke

Return type

null (empty response body)

Authorization

AdminAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined