Get Data Store Table List
Retrieve a list of Data Store tables and views available in the Kahua Data Store.
Endpoint
GET /api/v1/datastore/tables
Path Parameters
This endpoint does not require path parameters.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| includeColumns | boolean | No | Include column names and SQL Server data types for each table |
| includeColumnDetails | boolean | No | Include additional column metadata such as size, precision, scale, ordinal position, and nullability |
Request Body
None
Response Body
The response will list all table and view metadata object in the data store. Optionally it will list columns and column details.
Status Code: 200
| Property | Type | Description |
|---|---|---|
| recordCount | integer | Number of records returned |
| records | Table[] | Array of Table metadata objects |
Table Metadata Object Fields
| Property | Type | Description |
|---|---|---|
| name | string | Name of the Data Store table or view |
| columns | Column[] | Optional array of Column metadata objects |
Column Metadata Object
| Property | Type | Description |
|---|---|---|
| columnName | string | Name of the column |
| dataType | string | SQL Server data type |
| columnOrdinal | integer | Position of the column within the table |
| allowDBNull | boolean | Indicates whether NULL values are allowed |
| columnSize | integer | Maximum size of the column |
| numericPrecision | integer | Numeric precision value for decimal types |
| numericScale | integer | Numeric scale value for decimal types |
Example Response
{
"recordCount": 3,
"records": [
{
"name": "kahua_AEC_DailyReport_DailyReport"
},
{
"name": "kahua_AEC_DailyReport_DailyReport_Attachments"
},
{
"name": "kahua_AEC_DailyReport_DailyReport_Companies"
}
]
}
Error Codes
| Status Code | Description |
|---|---|
| 400 | Invalid request or query parameter |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal server error |
Examples
Request
GET /api/v1/datastore/tables
curl --request GET \
--url https://service.kahua.com/api/v1/datastore/tables \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json'
Response
{
"recordCount": 1,
"records": [
{
"name": "kahua_AEC_DailyReport_DailyReport"
}
]
}
Request
GET /api/v1/datastore/tables?includeColumns=true
curl --request GET \
--url 'https://service.kahua.com/api/v1/datastore/tables?includeColumns=true' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json'
Response
{
"recordCount": 670,
"records": [
{
"name": "kahua_AEC_DailyReport_DailyReportCompany",
"columns": [
{
"columnName": "Id",
"dataType": "bigint"
},
{
"columnName": "CreatedDateTime",
"dataType": "datetime"
},
{
"columnName": "EntityLinkUrl",
"dataType": "nvarchar"
}
]
}
]
}
Response truncated for brevity.
Request
GET /api/v1/datastore/tables?includeColumns=true&includeColumnDetails=true
curl --request GET \
--url 'https://service.kahua.com/api/v1/datastore/tables?includeColumns=true&includeColumnDetails=true' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json'
Response
{
"recordCount": 670,
"records": [
{
"name": "kahua_AEC_DailyReport_DailyReport",
"columns": [
{
"columnName": "Id",
"dataType": "bigint",
"columnOrdinal": 0,
"allowDBNull": false
},
{
"columnName": "EntityLinkUrl",
"dataType": "nvarchar",
"columnOrdinal": 5,
"allowDBNull": true,
"columnSize": 4000
},
{
"columnName": "TotalLaborUnits",
"dataType": "decimal",
"columnOrdinal": 17,
"allowDBNull": true,
"numericPrecision": 35,
"numericScale": 9
}
]
}
]
}
Response truncated for brevity.
- For SQL Server nvarchar columns, a columnSize value of 2147483647 is equivalent to nvarchar(MAX).
- This endpoint currently returns all tables in a single response and does not support pagination.