Query Meta Record¶
根据记录类型标识符等信息获取记录元数据。
请求格式¶
GET https://{api-gateway}/cds-meta-service/v1.0/record?action=query
请求参数¶
名称 |
位置 |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
记录所属的组织 ID。如何获取 orgId 信息>> |
recordTypes |
Query |
可选 |
String |
记录所属的记录类型的标识符,多个记录类型之间用英文逗号隔开。单次查询指定的记录类型数量不超过 100。如何获取 recordTypes 信息>> |
withSchema |
Query |
可选 |
Boolean |
是否返回记录模式。 |
locale |
Query |
可选 |
String |
中文:zh-CN, 英文:en-US, 日语:ja-JP,西班牙语:es-ES。默认为 en-US。 |
withI18n |
Query |
可选 |
Boolean |
是否返回完整的国际化内容。 |
返回内容类型¶
application/json; charset = UTF-8
返回码¶
参见 通用数据服务 API 返回码。
示例¶
请求示例¶
https://{api-gateway}/cds-meta-service/v1.0/record?action=query&orgId=yourOrgId
返回示例¶
{
"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"
}