Edit Code Table Field Value
Function
Edit the values of the fields in the lookup table.
Calling Method
For details, see Calling APIs.
URI
PUT /v2/{project_id}/design/code-tables/{id}/values
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Project ID and Account ID. |
|
id |
Yes |
String |
Entity ID, which is a string |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This field is mandatory for authentication using tokens. |
|
workspace |
Yes |
String |
Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID. |
|
X-Project-Id |
No |
String |
Project ID. For details about how to obtain the project ID, see Project ID and Account ID. This parameter is mandatory for API requests that use AK/SK authentication in multi-project scenarios. |
|
Content-Type |
No |
String |
Default value: application/json;charset=UTF-8 This parameter is optional. If the body is available, this parameter is mandatory. If the body is unavailable, you do not need to set this parameter or verify it. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
to_add |
No |
Array of CodeTableFieldVO objects |
The code table attribute and attribute value list are added. |
|
to_modify |
No |
Array of CodeTableFieldVO objects |
Edit the lookup table attribute value list. |
|
to_remove |
No |
Array of CodeTableFieldVO objects |
List of lookup table attribute IDs to be deleted. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
Lookup table field ID, which is a string |
|
code_table_id |
No |
String |
ID of the lookup table (mandatory for update), which is a string |
|
ordinal |
Yes |
Integer |
Sequence number. |
|
name_en |
Yes |
String |
Field name, in English. |
|
name_ch |
Yes |
String |
Field name, in Chinese. |
|
description |
No |
String |
Description. |
|
data_type |
Yes |
String |
Field type |
|
data_type_extend |
No |
String |
Extended field of the data type. |
|
is_unique_key |
No |
Boolean |
Whether the field is unique. |
|
code_table_field_values |
No |
Array of CodeTableFieldValueVO objects |
Code list attribute value. |
|
count_field_values |
No |
Integer |
Total number of lookup table attribute values. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
Lookup table field ID, which is a string |
|
fd_id |
No |
String |
Attribute ID of the lookup table, which is a string |
|
fd_value |
No |
String |
Code list attribute value. |
|
ordinal |
No |
Integer |
Sequence number. |
|
description |
No |
String |
Description. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
data |
data object |
data: unified outermost data structure of the returned result. |
|
Parameter |
Type |
Description |
|---|---|---|
|
value |
Array of CodeTableFieldVO objects |
Code table field list information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Lookup table field ID, which is a string |
|
code_table_id |
String |
ID of the lookup table (mandatory for update), which is a string |
|
ordinal |
Integer |
Sequence number. |
|
name_en |
String |
Field name, in English. |
|
name_ch |
String |
Field name, in Chinese. |
|
description |
String |
Description. |
|
data_type |
String |
Field type |
|
domain_type |
String |
Domain to which a field type belongs. Options:
|
|
data_type_extend |
String |
Extended field of the data type. |
|
is_unique_key |
Boolean |
Whether the field is unique. |
|
code_table_field_values |
Array of CodeTableFieldValueVO objects |
Code list attribute value. |
|
count_field_values |
Integer |
Total number of lookup table attribute values. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Lookup table field ID, which is a string |
|
fd_id |
String |
Attribute ID of the lookup table, which is a string |
|
fd_value |
String |
Code list attribute value. |
|
ordinal |
Integer |
Sequence number. |
|
description |
String |
Description. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, for example, DS.6000, indicating that the request fails to be processed. |
|
error_msg |
String |
Error message |
|
data |
Object |
Returned data information. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, for example, DS.6000, indicating that the request fails to be processed. |
|
error_msg |
String |
Error message |
|
data |
Object |
Returned data information. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, for example, DS.6000, indicating that the request fails to be processed. |
|
error_msg |
String |
Error message |
|
data |
Object |
Returned data information. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, for example, DS.6000, indicating that the request fails to be processed. |
|
error_msg |
String |
Error message |
|
data |
Object |
Returned data information. |
Example Requests
Edit the field values of the lookup table based on the request parameters, including adding fields to the lookup table.
PUT https://{endpoint}/v2/{project_id}/design/code-tables/1230204979835502592/values
{
"to_add" : [ {
"id" : "178101",
"code_table_id" : "1230204979835502592",
"ordinal" : 1,
"name_en" : "code",
"name_ch" : "Message",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"fd_id" : "178101",
"fd_value" : "4",
"ordinal" : 4
} ],
"count_field_values" : 3
}, {
"id" : "178102",
"code_table_id" : "1230204979835502592",
"ordinal" : 2,
"name_en" : "province",
"name_ch" : "Economical",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"fd_id" : "178102",
"fd_value" : "Chongqing Province",
"ordinal" : 4
} ],
"count_field_values" : 3
}, {
"id" : "178103",
"code_table_id" : "1230204979835502592",
"ordinal" : 3,
"name_en" : "city",
"name_ch" : "Specifies the city where the customer is located.",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"fd_id" : "178103",
"fd_value" : "Chongqing Province",
"ordinal" : 4
} ],
"count_field_values" : 3
}, {
"id" : "178104",
"code_table_id" : "1230204979835502592",
"ordinal" : 4,
"name_en" : "county",
"name_ch" : "County",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"fd_id" : "178104",
"fd_value" : "Yudong District",
"ordinal" : 4
} ],
"count_field_values" : 3
} ]
}
Example Responses
Status code: 200
This operation succeeds, and the returned data is a CodeTableFieldVO array.
{
"data" : {
"value" : [ {
"id" : "178101",
"code_table_id" : "1230204979835502592",
"ordinal" : 1,
"name_en" : "code",
"name_ch" : "Message",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"id" : "19983446",
"fd_id" : "178101",
"fd_value" : "1",
"ordinal" : 1,
"description" : null
}, {
"id" : "19983450",
"fd_id" : "178101",
"fd_value" : "2",
"ordinal" : 2,
"description" : null
}, {
"id" : "19983454",
"fd_id" : "178101",
"fd_value" : "3",
"ordinal" : 3,
"description" : null
}, {
"id" : "19983554",
"fd_id" : "178101",
"fd_value" : "4",
"ordinal" : 4,
"description" : null
} ],
"count_field_values" : 4
}, {
"id" : "178102",
"code_table_id" : "1230204979835502592",
"ordinal" : 2,
"name_en" : "province",
"name_ch" : "Economical",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"id" : "19983447",
"fd_id" : "178102",
"fd_value" : "Anhui",
"ordinal" : 1,
"description" : null
}, {
"id" : "19983451",
"fd_id" : "178102",
"fd_value" : "Jiangsu",
"ordinal" : 2,
"description" : null
}, {
"id" : "19983455",
"fd_id" : "178102",
"fd_value" : "Shanghai",
"ordinal" : 3,
"description" : null
}, {
"id" : "19983555",
"fd_id" : "178102",
"fd_value" : "Chongqing Province",
"ordinal" : 4,
"description" : null
} ],
"count_field_values" : 4
}, {
"id" : "178103",
"code_table_id" : "1230204979835502592",
"ordinal" : 3,
"name_en" : "city",
"name_ch" : "Cities",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"id" : "19983448",
"fd_id" : "178103",
"fd_value" : "Hefei",
"ordinal" : 1,
"description" : null
}, {
"id" : "19983452",
"fd_id" : "178103",
"fd_value" : "Nanjing",
"ordinal" : 2,
"description" : null
}, {
"id" : "19983456",
"fd_id" : "178103",
"fd_value" : "Shanghai",
"ordinal" : 3,
"description" : null
}, {
"id" : "19983556",
"fd_id" : "178103",
"fd_value" : "Chongqing Province",
"ordinal" : 4,
"description" : null
} ],
"count_field_values" : 4
}, {
"id" : "178104",
"code_table_id" : "1230204979835502592",
"ordinal" : 4,
"name_en" : "county",
"name_ch" : "County",
"description" : "",
"data_type" : "STRING",
"domain_type" : null,
"data_type_extend" : null,
"is_unique_key" : false,
"code_table_field_values" : [ {
"id" : "19983449",
"fd_id" : "178104",
"fd_value" : "Yaohai District",
"ordinal" : 1,
"description" : null
}, {
"id" : "19983453",
"fd_id" : "178104",
"fd_value" : "Yuhuatai District",
"ordinal" : 2,
"description" : null
}, {
"id" : "19983457",
"fd_id" : "178104",
"fd_value" : "Pudong New Area",
"ordinal" : 3,
"description" : null
}, {
"id" : "19983557",
"fd_id" : "178104",
"fd_value" : "Yudong District",
"ordinal" : 4,
"description" : null
} ],
"count_field_values" : 4
} ]
}
}
Status code: 400
BadRequest
{
"error_code" : "DS.60xx",
"error_msg" : "The user request is illegal."
}
Status code: 401
Unauthorized
{
"error_code" : "DS.60xx",
"error_msg" : "User authentication failed."
}
Status code: 403
Forbidden
{
"error_code" : "DS.60xx",
"error_msg" : "The user does not have permission to call this API."
}
Status code: 404
Not Found
{
"error_code" : "DS.60xx",
"error_msg" : "The User Request API does not exist."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and the returned data is a CodeTableFieldVO array. |
|
400 |
BadRequest |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
Not Found |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.