데이터 테이블에서 데이터를 가져오는 데 사용됩니다.
이 API를 사용하려면 앱에 DaaS의 데이터 정의에서 데이터 테이블에 대한 읽기 액세스 권한이 부여되어야 합니다(자세한 내용은 여기 참조).
POST https://{{host}}/api/public/tables/{{tableName}}/query?sys_limit={{limit_value}}&sys_offset={{offset_value}}
쿼리 매개 변수
| 매개 변수 | 설명 |
|---|---|
| host | 환경 URL, 예: https://bots.kore.ai |
| tableName | 데이터를 가져올 테이블의 이름 |
| sys_limit | 가져올 최대 레코드 수입니다. 기본적으로 이 값은 10으로 설정되고 허용되는 최대값은 100입니다. |
| sys_offset | 결과 데이터 세트의 시작 부분에서 건너뛴 레코드 수입니다. |
본문 매개 변수
| 매개 변수 | 설명 |
|---|---|
| query |
가져올 행을 식별하는 필터 기준 "query":{
"expressions": [
{"field": "<col1_name>", "operand": "=/!=/</>", "value": "<value1>"},
{"field": "<col2_name>", "operand": "=/!=/</>", "value": "<value2>"}
],
"operator": "and/or"
}
|
권한 부여
다음 구문을 포함한 헤더에 JWT를 포함한 API를 호출합니다. auth: {{JWT}}
콘텐츠 유형 응답
application/json
샘플 요청
curl -X POST \
http://{{host}}/api/public/tables/{{tableName}}/query?sys_limit=4&sys_offset=0 \
-H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
-H 'content-type: application/json' \
-d '{
"query":{
"expressions": [
{"field": "firstName", "operand": "=", "value": "Jane"},
{"field": "lastName", "operand": "=", "value": "Doe"}
],
"operator": "or"
}
}'
샘플 응답
{
"metaInfo": [
{
"name": "gender",
"type": "string"
},
{
"name": "lastName",
"type": "string"
}
],
"queryResult": [
{
"age": male,
"last_name":tony,
}
]
}