Skip to main content

ApiKeysApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
createApiKeyPOST /api_keysCreate new api key for current user
deleteApiKeyDELETE /api_keys/{id}Delete provided api key
listApiKeysGET /api_keysLoad api keys for user

createApiKey#

/*** @returns DisplayApiKey**/async function createApiKey(body: CreateApiKeyBody, opts)

Create new api key for current user

Notes:#

Requires scope CreateApiKey. When query param user_id is provided requires admin role.

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let body = new YatJs.CreateApiKeyBody(); // CreateApiKeyBody // populate body...
let opts = {  'userId': null // String | User id for which api key should be applied};try {  let res = await api.apiKeys().createApiKey(body, opts);  // res is of type DisplayApiKey  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
bodyCreateApiKeyBody
userIdString
User id for which api key should be applied[optional]

Return type#

DisplayApiKey

Authorization#

two_factor

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

deleteApiKey#

/*** @returns DisplayApiKey**/async function deleteApiKey(id: String)

Delete provided api key

Notes:#

When key does not belong to current user requires Admin access

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let id = "id_example"; // String // populate id...
try {  let res = await api.apiKeys().deleteApiKey(id);  // res is of type DisplayApiKey  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
idString

Return type#

DisplayApiKey

Authorization#

two_factor

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

listApiKeys#

/*** @returns [DisplayApiKey]**/async function listApiKeys(opts)

Load api keys for user

Notes:#

If query param user_id is provided requires admin role.

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let opts = {  'userId': null // String | User id for which api key should be applied};try {  let res = await api.apiKeys().listApiKeys(opts);  // res is of type [DisplayApiKey]  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
userIdString
User id for which api key should be applied[optional]

Return type#

[DisplayApiKey]

Authorization#

two_factor

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /