Skip to content

Latest commit

 

History

History
222 lines (148 loc) · 6.94 KB

SettingsApi.md

File metadata and controls

222 lines (148 loc) · 6.94 KB

LiltNode.SettingsApi

All URIs are relative to https://lilt.com/2

Method HTTP request Description
getOrganizationSettings GET /settings/organization Get organization-level settings
getProjectSettings GET /settings/project/{projectId} Get settings for a project
getUserSettings GET /settings/user Get settings for the authenticated user
upsertSetting POST /settings Update or create a setting

getOrganizationSettings

{String: Setting} getOrganizationSettings()

Get organization-level settings

Get the organization-level settings for the active users organization Example CURL: ``` curl --location --request GET 'https://lilt.com/2/settings/organization?key=<API_KEY>' \ ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// 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';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.SettingsApi();
apiInstance.getOrganizationSettings().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

{String: Setting}

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

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

getProjectSettings

{String: Setting} getProjectSettings(projectId)

Get settings for a project

Get the settings as applied to a specific project. Active settings will combine project-level settings, organization-level settings and fallback to setting default values. Example CURL: ``` curl --location --request GET 'https://lilt.com/2/settings/project/123?key=<API_KEY>' \ ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// 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';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.SettingsApi();
let projectId = 56; // Number | A project id.
apiInstance.getProjectSettings(projectId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
projectId Number A project id.

Return type

{String: Setting}

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

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

getUserSettings

{String: Setting} getUserSettings()

Get settings for the authenticated user

Get the active settings applied to the authenticated user. Example CURL: ``` curl --location --request GET 'https://lilt.com/2/settings/user?key=<API_KEY>' \ ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// 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';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.SettingsApi();
apiInstance.getUserSettings().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

{String: Setting}

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

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

upsertSetting

SettingUpsertResponse upsertSetting(opts)

Update or create a setting

Create or update the value for the given setting and setting scope. Example CURL to set an organization-level setting: ``` curl --location --request POST 'https://lilt.com/2/settings?key=<API_KEY>' \ --header 'Content-Type: application/json' \ --data-raw '{ "settingName": "requireBatchQaTranslator", "value": false, "organizationId": 285, "scope": "Organization" }' ```

Example

import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// 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';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';

let apiInstance = new LiltNode.SettingsApi();
let opts = {
  'body': new LiltNode.SettingUpsertBody() // SettingUpsertBody | 
};
apiInstance.upsertSetting(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body SettingUpsertBody [optional]

Return type

SettingUpsertResponse

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

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