The "getLabelsLinkedToRecordIds" action returns label objects for the specified records in a table. You use the "ids" property to specify the records and the "databaseName", "ownerName", and "tableName" to specify the table.
Request examples
Minimal
This example returns the labels linked to records 1 and 2 in the table "my_table" owned by the default account and database
{
"action": "getLabelsLinkedToRecordIds",
"params":
{
"tableName": "my_table",
"ids": [1,2]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Maximal
This example returns the labels linked to records 1 and 2 in the table "my_table" owned by the "db" user in the "faircom" database .
{
"api": "db",
"action": "getLabelsLinkedToRecordIds",
"params":
{
"databaseName": "faircom",
"ownerName": "db",
"tableName": "my_table",
"ids": [1,2],
"verifyLinks": true
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response examples
Minimal
This example returns the record IDs from the specified table that have the specified label.
{
"result": {
"databaseName": "faircom",
"ownerName": "db",
"tableName": "my_table",
"labels":
[
{
"group": "myGroup",
"name": "myLabel1",
"ids": [1,2]
},
{
"group": "myGroup",
"name": "myLabel2",
"ids": [1,2]
}
]
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
databaseName |
The You specify this property when you want to use a different database instead of the default. This property is useful because objects, such as tables and code packages, can have the same name in multiple databases. This feature allows you to create multiple environments in the same server and reuse the same JSON actions in each environment. For example, you can create It is an error to set If no default database is specified during |
Defaults to the session's "defaultDatabaseName" property |
string | 1 to 64 bytes |
ownerName |
The You specify this property when you want to use a different account instead of the default. Your session's account must have the appropriate privileges to access the code package. This property is useful because objects, such as tables and code packages, can have the same name in the same database as long as different accounts own each object. This feature allows you to create duplicate objects for different users on the same server and reuse the same JSON actions on those objects. For example, an administrator can copy objects from a production environment to her account so she can troubleshoot an issue using the same JSON actions, JavaScript, and SQL code. It is an error to set If no default owner is specified during |
Optional with default of the session's "defaultOwnerName" property |
string | 1 to 64 bytes |
tableName |
The See table name in System specifications for the table naming requirements and limitations.
"params": {
"tableName": "ctreeTable"
} |
Required - No default value | string | 1 to 64 bytes |
ids |
An
|
Automatically generated by the server | array of integers | Each array item is an integer from 0 to 2147483647
|
verifyLinks |
The |
Optional with default of true
|
Boolean |
|
Response properties ("result")
| Property | Description | Default | Type |
|---|---|---|---|
databaseName |
The
|
string | 1 to 64 bytes |
ownerName |
The "ownerName" property identifies the user who owns an object (see Object owner). |
string | 0 to 64 bytes |
tableName |
The See table name in System specifications for the table naming requirements and limitations. |
string | 1 to 64 bytes |
labels |
The The
|
array of objects |
1 or more label objects
Values are managed in the Label API with the group of |
|
labels .group |
The The If the When you assign a group name to a label, the server automatically checks whether the group name exists in the list of groups returned by the "listLabelGroups" action. If the group name does not exist, the server adds the group name to the list. When you rename a group assigned to a label, the server automatically adds a new group name to the list and removes the previous group name if no other label uses it.
|
string | 1 to 64 bytes |
|
labels .name |
The The The
|
string | 1 to 64 bytes |
|
labels .ids |
The
|
array | 0 or more ids |