레코드 고급 검색
POST/crm-core/v1/records/search/advanced
복합 필터 조건(AND/OR 중첩), 정렬, 커서 기반 페이지네이션을 지원하는 검색 엔드포인트. 시스템 필드(name, tags 등)와 속성(data.) 필드를 혼합한 조건을 구성할 수 있다. 속성값 기반 조건은 내부적으로 record_values 컬렉션의 2단계 쿼리로 처리된다.
Body Params
| Name | Type | Required | Description |
|---|---|---|---|
| entityId | string | 검색 대상 개체 ID | |
| conditionGroup | Object | 최상위 조건 그룹 | |
| conditionGroup.operator | string | 조건 그룹 연산자. AND 또는 OR | |
| conditionGroup.conditions | Array | 하위 조건 또는 조건 그룹 목록 (최대 50개) | |
| conditionGroup.conditions[].field | string | 대상 필드명. 시스템 필드(name 등) 또는 data.{propertyId} | |
| conditionGroup.conditions[].operator | string | 비교 연산자 (아래 표 참고) | |
| conditionGroup.conditions[].value | any | 비교 값 | |
| startKey | string | 이전 응답의 nextKey를 넘겨 다음 페이지를 요청 | |
| limit | number | 페이지당 최대 건수. 최대 200, 기본값 20 | |
| sortFields | Array | 정렬 필드 목록. - 접두어로 내림차순. 예: -dateCreated |
Response
| Name | Type | Required | Description |
|---|---|---|---|
| data | Array | 매칭된 레코드 목록 (마스킹·서명 URL 반영) | |
| data[].recordId | string | 레코드 ID | |
| data[].entityId | string | 개체 ID | |
| data[].name | string | 레코드 이름 | |
| data[].data | Object | 속성값 맵 | |
| data[].tags | Array | 태그 배열 | |
| data[].dateCreated | date | 생성 시각 | |
| nextKey | string | 다음 페이지 커서. 마지막 페이지면 undefined |
Structure
코드 예제
const response = await fetch('https://api.solapi.com/crm-core/v1/records/search/advanced', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + TOKEN,
'Content-Type': 'application/json'
},
body: JSON.stringify({
entityId: 'CRMET1260423081530123XYZ11122233',
conditionGroup: {
operator: 'AND',
conditions: [
{ field: 'name', operator: 'contains', value: '홍' }
]
},
sortFields: ['-dateCreated'],
limit: 50
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.solapi.com/crm-core/v1/records/search/advanced',
headers={'Authorization': f'Bearer {TOKEN}'},
json={
'entityId': 'CRMET1260423081530123XYZ11122233',
'conditionGroup': {
'operator': 'AND',
'conditions': [
{'field': 'name', 'operator': 'contains', 'value': '홍'}
]
},
'sortFields': ['-dateCreated'],
'limit': 50
}
)
data = response.json()
curl -X POST 'https://api.solapi.com/crm-core/v1/records/search/advanced' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"entityId":"CRMET1260423081530123XYZ11122233","conditionGroup":{"operator":"AND","conditions":[{"field":"name","operator":"contains","value":"홍"}]},"limit":50}'
지원 연산자: `equals`, `not_equals`, `contains`, `not_contains`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `greater_than`, `less_than`, `greater_or_equal`, `less_or_equal`, `between`, `before`, `after`, `in_last_days`, `in_next_days`, `in_last_minutes`, `in_next_minutes`, `this_week`, `this_month`, `this_year`, `includes`, `excludes`, `includes_all`, `includes_any`.
조건 그룹은 최대 50개의 하위 조건을 가질 수 있다. 깊은 중첩은 쿼리 성능에 영향을 주므로 3단계 이상 중첩은 지양한다.