If you specify type = "crunch" for your custom app, it means that you know in advance your data schema. So you need to implement endpoint for getting the schema.
Request
Request body contains account and filter:
{
"filter": {
"query": "select * from test"
},
"account": {
"username": "test_user",
"password": "test$user!",
/*...*/
}
}
Response
Response should contain data schema with the following format:
{
"name": {
id: "name"
ignore: false
name: "Name"
readonly: false
type: "text"
},
"age": {
id: "age"
ignore: false
name: "Age"
readonly: false
type: "number"
},
/*...*/
}
Schema is JSON object where key is field and value if field description. Field description contains:
field | description | type |
---|---|---|
id | Field id | string |
ignore | Is field visible in fields catalog | boolean |
name | Field name | string |
description | Field description | string |
readonly | Disable modify field name and type | boolean |
type | Type of field | "id" | "text" | "number" | "date" | "array[text]" | "array[number]" | "array[date]" |