update_app_settings

To save the settings of an application in a resource, use the resource/update_app_settings method. The settings are stored as a JSON object under the application name. To get them, use the resource/get_app_settings method.

Endpoint

Copied!
svc=resource/update_app_settings&params={
  "resourceId": <long>,
  "app": "<text>",
  "settings": {}
}

Parameters

The request must contain the following parameters:

Parameter Description
resourceId Resource ID.
app Application name.
settings Application settings. Any JSON object.

The request replaces all the settings of the specified application with the value of settings. Keys that aren’t specified in settings are deleted, including nested keys. The settings of other applications don’t change. To delete all the settings of the application, specify an empty object: "settings":{}.

If you specify * in app, the value of settings replaces the settings of all the applications stored in the resource. In this case, the keys in settings must be application names, and the settings of the applications that aren’t specified are deleted.

Example:

Copied!
svc=resource/update_app_settings&params={
  "resourceId": 436,
  "app": "my_app",
  "settings": {
    "key1": "value1",
    "key2": [1, 2],
    "key3": {
      "key3_1": "value3_1"
    }
  }
}

Response

If the request is completed successfully, an empty object is returned:

Copied!
{}

If the request fails, an error code is returned.

Error codes

Error code Description
4 Wrong input parameters. For example, settings isn’t a JSON object.
6 Failed to save the settings.
7 The resource doesn’t exist, or the user has no Edit not mentioned properties access right to it.

If you find a mistake in the text, please select it and press Ctrl+Enter.