Skip to main content

App Settings

Retrieve, update and manage app settings.

npm install @dynatrace-sdk/client-app-settings

appSettingsObjectsClient

import { appSettingsObjectsClient } from '@dynatrace-sdk/client-app-settings';

deleteAppSettingsObjectByObjectId

appSettingsObjectsClient.deleteAppSettingsObjectByObjectId(config): Promise<void>

Deletes the specified settings object

Required scope: app-settings:objects:write Required permission: app-settings:objects:write

Parameters

NameTypeDescription
config.objectId*requiredstringThe ID of the required settings object.
config.optimisticLockingVersion*requiredstring

The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users.

It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update.

Code example

import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";

const data =
await appSettingsObjectsClient.deleteAppSettingsObjectByObjectId(
{ objectId: "...", optimisticLockingVersion: "..." },
);

getAppSettingsObjectByObjectId

appSettingsObjectsClient.getAppSettingsObjectByObjectId(config): Promise<AppSettingsObject>

Gets the specified settings object

Required scope: app-settings:objects:read Required permission: app-settings:objects:read

Gets the specified settings object. Properties of type secret will be included in plain text if the call originates from a serverless function of your app; they will have irreversibly masked values otherwise. This protects these secrets from leaking to users of your app or other third parties.

Parameters

NameTypeDescription
config.objectId*requiredstringThe ID of the required settings object.

Returns

Success

Code example

import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";

const data =
await appSettingsObjectsClient.getAppSettingsObjectByObjectId(
{ objectId: "..." },
);

getAppSettingsObjects

appSettingsObjectsClient.getAppSettingsObjects(config): Promise<AppSettingsObjectsList>

Lists persisted settings objects

Required scope: app-settings:objects:read Required permission: app-settings:objects:read

Lists persisted settings objects for selected schemas.

If nothing is persisted or if all persisted settings objects are not accessible due to missing permissions, no items will be returned.

To query the effective values (including schema defaults) please see getEffectiveAppSettingsValues.

Properties of type secret will be included in plain text if the call originates from a serverless function of your app; they will have irreversibly masked values otherwise. This protects these secrets from leaking to users of your app or other third parties.

Parameters

NameTypeDescription
config.addFieldsstring

A list of fields to be included to the response. The provided set of fields extends the default set.

Specify the required top-level fields, separated by commas (for example, summary,value).

Supported fields: objectId, version, summary, searchSummary, schemaId, schemaVersion, modificationInfo, value.

Default fields: objectId, version.

default: "objectId, version"
config.pageKeystring

The cursor for the next page of results. You can find it in the nextPageKey field of the previous response.

The first page is always returned if you don't specify the page-key query parameter.

When the page-key is set to obtain subsequent pages, you must omit all other query parameters.

config.pageSizenumber

The amount of settings objects in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

config.schemaIdsstring

A list of comma-separated schema IDs to which the requested objects belong.

To load the first page, when the nextPageKey is not set, this parameter is required.

Returns

Success. Accessible objects returned.

Code example

import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";

const data =
await appSettingsObjectsClient.getAppSettingsObjects();

getEffectiveAppSettingsValues

appSettingsObjectsClient.getEffectiveAppSettingsValues(config): Promise<EffectiveAppSettingsValuesList>

Lists effective settings values

Required scope: app-settings:objects:read Required permission: app-settings:objects:read

Lists effective settings values for selected schemas. If no object is persisted for a schema with "multiObject": false, the default value as defined in the schema will be returned.

Properties of type secret will be included in plain text if the call originates from a serverless function of your app; they will have irreversibly masked values otherwise. This protects these secrets from leaking to users of your app or other third parties.

Parameters

NameTypeDescription
config.addFieldsstring

A list of fields to be included to the response. The provided set of fields extends the default set.

Specify the required top-level fields, separated by commas (for example, summary,schemaId).

Supported fields: summary, searchSummary, schemaId, schemaVersion, modificationInfo, value.

Default fields: value.

default: "value"
config.pageKeystring

The cursor for the next page of results. You can find it in the nextPageKey field of the previous response.

The first page is always returned if you don't specify the page-key query parameter.

When the page-key is set to obtain subsequent pages, you must omit all other query parameters.

config.pageSizenumber

The amount of settings objects in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

config.schemaIdsstring

A list of comma-separated schema IDs to which the requested objects belong.

Only considered on load of the first page, when the nextPageKey is not set.

Returns

Success

Code example

import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";

const data =
await appSettingsObjectsClient.getEffectiveAppSettingsValues();

postAppSettingsObject

appSettingsObjectsClient.postAppSettingsObject(config): Promise<void | AppSettingsObjectResponse>

Creates a new settings object

Required scope: app-settings:objects:write Required permission: app-settings:objects:write

Creates a new settings object.

Parameters

NameTypeDescription
config.body*requiredAppSettingsObjectCreate
config.validateOnlybooleanIf true, the request runs only validation of the submitted settings objects, without saving them. default: false

Returns

Created

Code example

import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";

const data =
await appSettingsObjectsClient.postAppSettingsObject({
body: { schemaId: "jira-connection" },
});

putAppSettingsObjectByObjectId

appSettingsObjectsClient.putAppSettingsObjectByObjectId(config): Promise<void>

Updates an existing settings object

Required scope: app-settings:objects:write Required permission: app-settings:objects:write

Updates an existing settings object with new values. To update a property of the secret type you need to pass the new value unmasked. To keep the current value, send the current masked secret. You can obtain it via GET an object endpoint.

Some schemas don't allow passing of the masked secret. In that case you need to send the unmasked secret with every update of the object.

Parameters

NameTypeDescription
config.body*requiredAppSettingsObjectUpdate
config.objectId*requiredstringThe ID of the required settings object.
config.optimisticLockingVersion*requiredstring

The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users.

It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update.

Code example

import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";

const data =
await appSettingsObjectsClient.putAppSettingsObjectByObjectId(
{
objectId: "...",
optimisticLockingVersion: "...",
body: {},
},
);

Types

AppSettingsError

NameTypeDescription
codenumberThe HTTP status code
detailsAppSettingsErrorDetails
message*requiredstringThe error message

AppSettingsErrorDetails

The error details

NameTypeDescription
constraintViolationsArray<ConstraintViolation>A list of constraint violations
missingScopesArray<string>In case of a 403 - Forbidden response, a list of missing scopes necessary to successfully execute the request

AppSettingsErrorEnvelope

NameType
error*requiredAppSettingsError

AppSettingsModificationInfo

Modification information about the app setting.

NameTypeDescription
createdBystringThe unique identifier of the user who created the app setting.
createdTimeDateTimestamp when the app settings was created in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
lastModifiedBystringThe unique identifier of the user who performed the most recent modification.
lastModifiedTimeDateTimestamp when the app setting was last modified in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

AppSettingsObject

A settings object.

NameTypeDescription
modificationInfoAppSettingsModificationInfo
objectId*requiredstringThe ID of the settings object.
schemaIdstringThe schema on which the object is based.
schemaVersionstringThe version of the schema on which the object is based.
searchSummarystringA searchable summary string of the setting value. Plain text without Markdown.
summarystringA short summary of settings. This can contain Markdown and will be escaped accordingly.
valueAppSettingsValue
version*requiredstring

The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users.

It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update.

AppSettingsObjectCreate

Configuration of a new settings object.

NameTypeDescription
insertAfterstring

The position of the new object. The new object will be added after the specified one.

If null, the new object will be placed in the last position.

If set to empty string, the new object will be placed in the first position.

Only applicable for objects based on schemas with ordered objects (schema's ordered parameter is set to true).

schemaId*requiredstringThe schema on which the object is based.
value*requiredAppSettingsValue

AppSettingsObjectResponse

The response to a creation request.

NameTypeDescription
objectId*requiredstringThe ID of the created settings object.
version*requiredstring

The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users.

It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update.

AppSettingsObjectUpdate

An update of a settings object.

NameTypeDescription
insertAfterstring

The position of the updated object. The new object will be moved behind the specified one.

insertAfter and insertBefore are evaluated together and only one of both can be set.

If null and insertBefore 'null', the existing object keeps the current position.

If set to empty string, the updated object will be placed in the first position.

Only applicable for objects based on schemas with ordered objects (schema's ordered parameter is set to true).

insertBeforestring

The position of the updated object. The new object will be moved in front of the specified one.

insertAfter and insertBefore are evaluated together and only one of both can be set.

If null and insertAfter 'null', the existing object keeps the current position.

If set to empty string, the updated object will be placed in the last position.

Only applicable for objects based on schemas with ordered objects (schema's ordered parameter is set to true).

value*requiredAppSettingsValue

AppSettingsObjectsList

A list of settings objects.

NameTypeDescription
items*requiredArray<AppSettingsObject>A list of settings objects.
nextPageKeystring

The cursor for the next page of results. Has the value of null on the last page.

Use it in the nextPageKey query parameter to obtain subsequent pages of the result.

pageSize*requirednumberThe number of entries per page.
totalCount*requirednumberThe total number of entries in the result.

ConstraintViolation

A list of constraint violations

NameType
locationstring
messagestring
parameterLocationConstraintViolationParameterLocation
pathstring

EffectiveAppSettingsValue

An effective settings value.

NameTypeDescription
modificationInfoAppSettingsModificationInfo
schemaIdstringThe schema on which the object is based.
schemaVersionstringThe version of the schema on which the object is based.
searchSummarystringA searchable summary string of the setting value. Plain text without Markdown.
summarystringA short summary of settings. This can contain Markdown and will be escaped accordingly.
valueAppSettingsValue

EffectiveAppSettingsValuesList

A list of effective settings values.

NameTypeDescription
items*requiredArray<EffectiveAppSettingsValue>A list of effective settings values.
nextPageKeystring

The cursor for the next page of results. Has the value of null on the last page.

Use it in the nextPageKey query parameter to obtain subsequent pages of the result.

pageSize*requirednumberThe number of entries per page.
totalCount*requirednumberThe total number of entries in the result.

Enums

ConstraintViolationParameterLocation

Enum keys

Header | Path | PayloadBody | Query

Still have questions?
Find answers in the Dynatrace Community