Query Record¶
Get third-party records by record type IDs.
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 >> |
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. |
recordTypes | Body | Mandatory | 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>> |
fields | Body | Mandatory | String | The field of the record. Separate multiple fields by commas. |
filter | Body | Optional | String | Specify how to filter the returned data by record fields. For example, [[{“field”:”field1”,”operator”:”>=”,”value”:”1”},{“field”:”field2”,”operator”:”<=”,”value”:”2”}],[{“field”:”field3”,”operator”:”==”,”value”:”3”}]], which means the returned data is filtered by (field1 >= 1 and field2 <= 2) or (field3=3). |
orderBy | Body | Optional | String | Specify how to sort the returned data by record fields. For example, [{“field”:”field1”,”order”:”ASC”}, {“field”:”field2”,”order”:”DESC”}], which means the returned data is sorted first by field1 in ascending order and then by field2 in descending order. |
pageSize | Body | Optional | Integer | The number of the returned records on a single page. |
pageNo | Body | Optional | Integer | The number of page to be returned. |
Samples¶
Request Sample¶
#requestURI:
POST https://{api-gateway}/cds-record-service/v1.0/record?action=query&orgId=yourOrgId&locale=yourLocale
#requestBody:
{
"recordTypes":"SR",
"fields": "a,b,c",
"filter": [[{"field":"field1","operator":">=","value":"1"},{"field":"field2","operator":"<=","value":"2"}],[{"field":"field3","operator":"==","value":"3"}]],
"orderBy": [{"field":"field1","order":"ASC"}, {"field":"field2","order":"DESC"}],
"pageSize": 100,
"pageNo": 1
}
Response Sample¶
{
"data": [
{
"recordType":"SR",
"field1": "",
"field2":"",
"field3":""
},
{
"recordType":"SR",
"field1": "",
"field2":"",
"field3":""
}
],
"pagination": {
"pageNo": 1,
"pageSize": 10,
"totalSize": 100
},
"code": 0,
"msg": "OK",
"traceId": "1234567890abcdefghijkl0987654321"
}