1Save Dynamic Fields
Overview
This API saves multiple dynamic group fields in a Workbook.
Method: POST
Request URL: {kyvos-url}/rest/v2/viewer/{name-or-id}/save-dynamic-fields
Authorization
API Key: sessionid
This method authenticates requests using a session ID which acts like an API key.
BasicAuth: HTTP Authorization Scheme
This method authenticates requests using a username and password sent in the HTTP Authorization header.
Headers
Header Name | Type | Description | Possible Values |
|---|---|---|---|
Content-Type (Required) | String | Specifies the media type of the request body. |
|
sessionid | String | The session ID is the token received from the login API. Note: Session ID is required for token-based authentication. | – |
Path Parameters
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
name-or-id (Required) | String | Name or ID of the Workbook for which dynamic group fields are to be saved. Note: If the Workbook name is provided, either folderName or folderId must also be provided. | – |
Query Parameters
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
by | String | Specifies whether the name-or-id parameter should be interpreted as a Workbook name or Workbook ID. If by=name, provide the Workbook name in the name-or-id parameter. If by=id, provide the Workbook ID in the name-or-id parameter. The default value is name. | – |
Request Body
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
folderName | String | Name of the folder containing the Workbook. If the Workbook is present in the root directory, specify Note: If neither folderName nor folderId is provided, the Workbook will be treated as a root-level entity by default. | – |
folderId | String | ID of the folder containing the Workbook. | – |
dynamicMemberFieldsJson (Required) | String | JSON containing multiple dynamic group fields. Based on the action property of each field (for example, Note: An example JSON is provided under the Resources section below. | – |
Responses
200 Success
{
"code": "0",
"errorMessage": "",
"message": "Successfully saved dynamic members."
}Status Code | Description |
|---|---|
401 | Authorization information is missing or invalid. |
404 | Connection, database, schema, or table not found. |
412 | Precondition failed. Required parameter missing. |
500 | Internal Server Error |
Resources
Below is an example of JSON structure which can be used as a reference for the dynamicMemberFieldsJSON parameter in the request body.
{
"groupFields":[
{
"baseFieldInfo":{
"dimensionId":"DIM_77",
"name":"OrderPriority (%)",
"id":"DIMENSION_ATTRIBUTE_168",
"type":"ATTRIBUTE"
},
"semanticModel":{
"name":"OrderDate_ValueBased",
"id":"17246636471674127064015165867288",
"folderName":"Kyvos_NoSpark"
},
"dataType":"CHAR",
"name":"DynamicGroupField_1",
"action":"",
"description":"",
"id":"DYNAMIC_MEMBER_624133",
"memberGroups":[
{
"isCustomName":false,
"values":{
"dataSeperator":"|$|",
"distinct":"Critical|$|High"
},
"name":"Critical & High"
}
],
"type":"LIST",
"otherGroupLabel":"Others",
"remainingMembersAsOthers":false,
"tags":""
}
]
}JSON Field Definitions
Field | Type | Description | Possible Values | Example |
groupFields | array | A list of dynamic fields. Required. | One object per dynamic field. | [{...}, {...}] |
groupFields[*].id | string | A unique ID for this dynamic field. Required. | Any string, typically "DYNAMIC_MEMBER_" + random. | "DYNAMIC_MEMBER_123456" |
groupFields[*].name | string | The display name of the dynamic field. Required. | Any text. | "Customer Segments" |
groupFields[*].action | string | The operation to perform for this field. Required. | ADD, UPDATE, DELETE, or "" (blank for existing fields). | "ADD" |
groupFields[*].dataType | string | The data type of the dynamic field's output. Required. | CHAR, NUMBER, DATE | "CHAR" |
groupFields[*].type | string | The kind of object this dynamic field represents. Required. | LIST | "LIST" |
groupFields[*].description | string | A short description of the dynamic field. Optional. | Any text. | "Groups customers by region" |
groupFields[*].tags | string | Tags for the field, for categorization. Optional. | Any text. | "sales, regions" |
groupFields[*].remainingMembersAsOthers | boolean | If true, any base members not placed in a named group are put into an "Others" bucket. Required. | true, false | TRUE |
groupFields[*].otherGroupLabel | string | The label for the catch-all "Others" bucket. Required when remainingMembersAsOthers is true. | Any text. | "Other Regions" |
groupFields[*].semanticModel | object | The semantic model that owns the base field. Required. | Nested object with id, name, folderName. | {...} |
groupFields[*].semanticModel.id | string | ID of the semantic model. Required. | Any valid semantic model ID. | "17748606041027127091090133193817" |
groupFields[*].semanticModel.name | string | Name of the semantic model. Required. | Any valid semantic model name. | "AdventureWorks" |
groupFields[*].semanticModel.folderName | string | Folder name of the semantic model. Required. | Any valid folder name. | "Kyvos_NoSpark" |
groupFields[*].baseFieldInfo | object | The original dimension, hierarchy, or attribute that the dynamic field is built on. Required. | Nested object. | {...} |
groupFields[*].baseFieldInfo.id | string | ID of the base field. Required. | Any string. | "[Customer].[H_Customer].[Name]" |
groupFields[*].baseFieldInfo.name | string | Name of the base field. Required. | Any text. | "Customer Name" |
groupFields[*].baseFieldInfo.type | string | Type of the base field. Required. | ATTRIBUTE or a level/hierarchy type. | "ATTRIBUTE" |
groupFields[*].baseFieldInfo.hierarchyId | string | The hierarchy the base field belongs to. Optional for ATTRIBUTE type; Required otherwise. | Any string. | "[Customer].[H_Customer]" |
groupFields[*].baseFieldInfo.dimensionId | string | The dimension the base field belongs to. Required. | Any string. | "[Customer].[H_Customer]" |
groupFields[*].memberGroups | array | The custom groups (buckets) created from the base field. Required. | One object per group. | [{...}, {...}] |
groupFields[*].memberGroups[*].name | string | The display name of this custom group. Required. | Any text. | "North America" |
groupFields[*].memberGroups[*].isCustomName | boolean | Whether this group name is manually entered or auto-generated. Required. | true, false | TRUE |
groupFields[*].memberGroups[*].values | object | The set of original values that belong to this group. Required. | Nested object. | {...} |
groupFields[*].memberGroups[*].values.distinct | string | The group values as a single string, joined by the separator. Required. | A string. | `"USA |
groupFields[*].memberGroups[*].values.dataSeperator | string | The separator used in distinct. Required. | Any single character or string. | "|" |