Updated on 2022-09-15 GMT+08:00

Obtaining Field Values in a Lookup Table

Function

This API is used to obtain the field values in a lookup table.

URI

GET /v2/{project_id}/design/code-tables/{id}/values

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

id

Yes

String

Entity ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of records to be queried, that is, Y records. The value ranges from 1 to 100. The default value is 50.

Maximum: 100

Default: 50

offset

No

Integer

Query offset, that is, X data records are skipped. The value must be 0 or an integer multiple of limit. If the value does not meet the requirements, it will be rounded down. The default value is 0.

Default: 0

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

max_ordinal

Integer

Maximum ordinal

total

Integer

Total number of records

records

Array of CodeTableFieldVO objects

Lookup table attribute information

Table 4 CodeTableFieldVO

Parameter

Type

Description

id

Long

ID

code_table_id

Long

Lookup table ID

ordinal

Integer

Ordinal

name_en

String

Field name in English

Maximum: 600

name_ch

String

Field name in Chinese

Maximum: 200

description

String

Description

Maximum: 600

data_type

String

Data type

domain_type

String

Data type domains

Enumeration values:

  • NUMBER

  • STRING

  • DATETIME

  • BLOB

  • OTHER

data_type_extend

String

Data type extended field

Maximum: 50

is_unique_key

Boolean

Whether the attribute is unique

Default: false

code_table_field_values

Array of CodeTableFieldValueVO objects

Lookup table attribute value

count_field_values

Integer

Number of lookup table attribute values

Table 5 CodeTableFieldValueVO

Parameter

Type

Description

id

Long

ID

fd_id

Long

Lookup table attribute ID

fd_value

String

Lookup table attribute value

ordinal

Integer

Ordinal

description

String

Description

Maximum: 600

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Example Requests

None

Example Responses

Status code: 200

The operation succeeds. The CodeTableFieldInfoVO array and the total number of field values are returned.

{
  "max_ordinal" : 2,
  "total" : 2,
  "records" : [ {
    "id" : "66929",
    "code_table_id" : "1012307352952635392",
    "ordinal" : 1,
    "name_en" : "code",
    "name_ch" : "Code",
    "description" : "",
    "data_type" : "STRING",
    "domain_type" : null,
    "data_type_extend" : null,
    "is_unique_key" : false,
    "code_table_field_values" : [ {
      "id" : "2733087",
      "fd_id" : "66929",
      "fd_value" : "Femal",
      "ordinal" : 1,
      "description" : null
    }, {
      "id" : "2733089",
      "fd_id" : "66929",
      "fd_value" : "Ma",
      "ordinal" : 2,
      "description" : null
    } ],
    "count_field_values" : 2
  }, {
    "id" : "66930",
    "code_table_id" : "1012307352952635392",
    "ordinal" : 2,
    "name_en" : "value",
    "name_ch" : "Value",
    "description" : "",
    "data_type" : "STRING",
    "domain_type" : null,
    "data_type_extend" : null,
    "is_unique_key" : false,
    "code_table_field_values" : [ {
      "id" : "2733088",
      "fd_id" : "66930",
      "fd_value" : "0",
      "ordinal" : 1,
      "description" : null
    }, {
      "id" : "2733090",
      "fd_id" : "66930",
      "fd_value" : "1",
      "ordinal" : 2,
      "description" : null
    } ],
    "count_field_values" : 2
  } ]
}

Status Codes

Status Code

Description

200

The operation succeeds. The CodeTableFieldInfoVO array and the total number of field values are returned.

400

BadRequest

401

Unauthorized

403

Forbidden

404

Not Found