Add

[POST] .../v1/applicationsetting/add

Adds a new user-defined application setting (sap_system = 0). Use this method to create a new user-defined application setting definition before users can read or override its value through GetValues and EditValues. The request requires a valid app_id, a unique key within that application, a supported dataType and a name_var translation key; this controller method does not perform a separate RBAC permission check and key and name_var must be no longer than 200 characters. The method validates default_value according to dataType, stores the definition in sys_app_settings_ref with sap_system = 0 and returns new_id for the created setting. Business errors such as missing body, invalid app_id, unknown application, empty or too long key, duplicate key, invalid dataType, invalid default_value, empty or too long name_var, database failures or transaction failures are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
app_id Int32 Required Application ID.
dataType String Required Data type: Integer, Float, String, DateTime. Allowed values: Integer, Float, String, DateTime.
default_value String Optional Default value.
key String Required Setting key, up to 200 characters and unique within app_id.
name_var String Required Translation key, up to 200 characters.

Request Example

{
  "app_id": 1,
  "dataType": "Integer",
  "default_value": "string",
  "key": "string",
  "name_var": "string"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 1
  }
}