Query Meta Record


Get meta records by record type IDs.

Request Format


GET https://{api-gateway}/cds-meta-service/v1.0/record?action=query

Request Parameters


Name

Location

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The organization ID which the record belongs to. How to get orgId >>

recordTypes

Query

Optional

String

The record type ID which the record belongs to. Separate multiple IDs by commas. Up to 100 record types are allowed in a single query. How to get recordTypes>>

withSchema

Query

Optional

Boolean

Whether to return the schema of the record.

locale

Query

Optional

String

Use zh-CN, en-US, ja-JP, or es-ES. If not specified, the value is set to en_US by default.

withI18n

Query

Optional

Boolean

Whether to return the internationalization content. The value is true or false. Default is false.

Response Content Type


application/json; charset = UTF-8

Response Parameters


Name

To Return Definitely/Conditionally

Data Type

Description

recordType

Definitely

String

The identifier of the record type.

name

Definitely

String

The name of the record type in the corresponding request language.

nameI18n

Conditionally

I18n Struct

Describe the internalization content of the record type name. See I18n Struct.

references

Conditionally

RecordReference Struct

Describe the associated parent record type. See RecordReference Struct.

schema

Definitely

RecordField Struct

Describe the field information of the record type. See RecordField Struct.

I18n Struct


Name

To Return Definitely/Conditionally

Data Type

Description

defaultValue

Definitely

String

The default content.

en_US

Conditionally

String

The English content.

zh_CN

Conditionally

String

The Chinese content.

es_ES

Conditionally

String

The Spanish content.

ja_JP

Conditionally

String

The Japanese content.

RecordReference Struct


Name

To Return Definitely/Conditionally

Data Type

Description

recordType

Definitely

String

The associated parent record type.

foreignKeys

Definitely

Map (The Key and Value are of the String type)

Describe the field information of the parent record type.

RecordField Struct


Name

To Return Definitely/Conditionally

Data Type

Description

field

Definitely

String

The identifier of the record field.

name

Definitely

String

The name of the record field in the corresponding request language.

nameI18n

Conditionally

I18n Struct

Describe the internalization content of the record field name. See I18n Struct.

description

Conditionally

String

The description of the record field in the corresponding request language.

descriptionI18n

Conditionally

I18n Struct

Describe the internalization content of the record field description. See I18n Struct.

isI18n

Definitely

Boolean

Whether the field content is I18n Struct.

dataType

Definitely

String

The data type of the field.

units

Conditionally

String

The unit of the field.

sortable

Definitely

Boolean

Whether the field is sortable.

filters

Conditionally

List (The Value is of the String type)

The supported filters of the field.

expression

Conditionally

String

The expression of the field.

enumerate

Conditionally

Enumerate Struct

Describe the enumeration values of the enumerated field. See Enumerate Struct.

isSubRecordType

Conditionally

Boolean

Whether the field is associated with a child record type.

subRecordFields

Conditionally

String

The fields of the associated child record type.

Enumerate Struct


Name

To Return Definitely/Conditionally

Data Type

Description

name

Definitely

String

The name of the enumeration values in the corresponding request language.

nameI18n

Conditionally

I18n Struct

Describe the internalization content of the enumeration values. See I18n Struct.

Response Codes


See Common Data Service API Response Codes.

Samples

Request Sample


https://{api-gateway}/cds-meta-service/v1.0/record?action=query&orgId=yourOrgId

Response Sample


{
   "data":[
        {
            "recordType":"SR",
            "name": "Service Request",
            "references": [
                {
                    "recordType": "WO",
                    "foreignKeys": {
                        "fieldOfThisType": "fieldOfForeignType"
                    }
                }
            ],
            "schema": [{
                "field":"field1",
                "name":"field1",
                "isI18n": false,
                "dataType":"String",
                "units":"--",
                "sortable":false,
                "filters":["in",">=",">","==","<","<=","startWith","between"],
                "expression":"rawField1",
                "enum":{
                    "0": {
                            "nameI18n": {
                            "defaultValue": "Normal",
                            "i18nValue": {
                                "en_US": "Normal",
                                "zh_CN": "健康"
                            }
                        }
                    },
                     "1": {
                            "nameI18n": {
                            "defaultValue": "Underperformed",
                            "i18nValue": {
                                "en_US": "Underperformed",
                                "zh_CN": "亚健康"
                             }
                        }
                    }
                }
            },
            {
                "field":"field2",
                "name":"field2",
                "isI18n": false,
                "dataType":"Double",
                "units":"kW",
                "sortable":true,
                "filters":[],
                "expression":"rawField2",
                "enum":{}
            }]
        },
        {
            "recordType":"WO",
            "name": "Work Order",
            "schema": [{
                "field":"field1",
                "name":"field1",
                "isI18n": false,
                "dataType":"String",
                "units":"--",
                "sortable":false,
                "filters":["in",">=",">","==","<","<="],
                "expression":"rawField1",
                "enum":{}
            },
            {
                "field":"field2",
                "name":"field2",
                "isI18n": false,
                "dataType":"Double",
                "units":"kW",
                "sortable":true,
                "filters":[],
                "expression":"rawField2",
                "enum":{}
            }]
        }
   ],
   "code":0,
   "msg":"OK",
   "traceId": "1234567890abcdefghijkl0987654321"
}