Skip to main content

"listLabelGroups"

Retrieves a list of all the groups used by the existing labels

The "listLabelGroups" action retrieves a list of all the groups used by the existing labels.

Tip

If your application plans on creating many groups, you can use a delimiter character, such as the forward slash / in your group names to create a group hierarchy. Include the delimiter after each part of the hierarchy and at the end of the group name. You can use the "partialGroupFilter" filter to return subsets of groups in the hierarchy. For example, you if have groups named "product/size/", "product/weight/", "product/ranking/", "person/gender/", and "person/ranking/", you can set the "partialGroupFilter" filter to "product/" to return the product groups.

Request examples

Minimal

{
  "api": "admin",
  "action": "listLabelGroups",
  "params": { },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
{
  "api": "admin",
  "action": "listLabelGroups",
  "params": {
    "partialGroupFilter": "my group"
  },
  "responseOptions": {
    "dataFormat": "objects",
    "numberFormat": "string",
    "binaryFormat": "hex"
  },
  "authToken": "replaceWithAuthTokenFromCreateSession",
  "apiVersion": "1.0",
  "requestId": "2",
  "debug": "max"
}
{
  "authToken": "authToken",
  "result": {
    "groups": []
  },
  "requestId": "2",
  "debugInfo": {
    "request": {
      "authToken": "authToken",
      "api": "admin",
      "action": "listLabelGroups",
      "params": {
        "partialGroupFilter": "my group"
      },
      "apiVersion": "1.0",
      "requestId": "2",
      "responseOptions": {
        "dataFormat": "objects",
        "numberFormat": "string",
        "binaryFormat": "hex"
      },
      "debug": "max"
    }
  },
  "errorCode": 0,
  "errorMessage": ""
}

"listLabelGroups" retrieves a list of all the groups used by the existing labels

list label grouplistLabelGroupslist groupslabel APIjsonAction
Table 1. listLabelGroups "params" properties summary

Property

Description

Default

Type

Limits (inclusive)

partialGroupFilter

(optional) includes labels in the specified group hierarchy

""

string

1 to 64 bytes



The "partialGroupFilter" property optionally filters the results of the "listLabels" and "changeLabels" actions. It defaults to null, which provides no filtering. It is an array of strings, such as "partialGroupFilter":["mylabelGroupName","anotherGroupName"]. Each string is the partial or full name of a group and may be up to 64 bytes long. The "group" property of a label must partially match the group in the array to be included in the results.

Warning

When deleting properties, ensure each partial and full group name in the array properly filters the labels; otherwise, the "changeLabels" action will delete more labels than you want.

Would you like to provide feedback?