Documentation
  • The Fundamental
  • ACTIVE SYNC
    • Data Ingestion
      • Data Tracking
        • API Key Management
        • Generate Tracking ID
        • Install tracking with Tag Manager
        • Install Tracking from the Console
        • Tracking Method on Website
      • Datasource
        • MySQL
        • PostgreSQL
        • MongoDB
        • Microsoft SQL Server
        • Shopify
        • CSV
        • Google Sheets
    • Data Ingestion API
      • Data Lake
        • File upload
        • Tracking API
      • Data Warehouse
        • Batch upload
        • CSV upload
        • Tracking API
      • Data Schema Warehouse API
    • Data Integrations
      • Manage your API Key
      • Get Data using API
  • ROCKET.BI
    • Introduction
    • Data Warehouse
      • Data Management
      • Ad-hoc Query
        • Measure Schema
        • Calculated Field
      • Query Analysis
      • Relationship
    • Row-level Security
    • Dashboard
      • Dashboard Filter
      • Chart Control
        • Tab Control
        • Single Choice
        • Multiple Choice
        • Dropdown Control
        • Slicer Control
        • Date Control
        • Input Control
      • Manage Dashboard
        • Relationship
        • View and Share
        • Select Main Date Filter
        • Boost
        • Settings
        • Add Chart
        • Add Tab
        • Add Text
    • Chart Builder
      • Chart Types
        • Pie Chart
        • Column Chart
        • Bar Chart
        • Line Chart
        • Line Stock Chart
        • Pareto Chart
        • Bubble Chart
        • Scatter Chart
        • Map Chart
        • Area Chart
        • KPI Chart
        • Lollipop Chart
        • Parliament Chart
        • Funnel Chart
        • Pyramid Chart
        • Gauge Chart
        • Bullet Graph Chart
        • Heat Map Chart
        • Word Cloud Chart
        • Tree Map Chart
        • Stacked Column Chart
        • Stacked Bar Chart
        • Sankey Chart
        • Spider Web Chart
        • Wind Rose Chart
        • Histogram Chart
        • Bell Curve Chart
        • Table Chart
        • Pivot Table Chart
      • Chart Settings
        • Zoom
        • Inner chart filter
      • Chart Filters
        • Tab Filter
        • Single Choice
        • Multiple Choice
        • Dropdown Filter
        • Slicer Filter
        • Date Filter
        • Input Filter
      • Right-click Settings
        • Change date function
        • Drill down
        • Drill through
        • Use as a filter
    • SQL Query
      • Syntax
      • Functions
      • Aggregate Functions
      • Data Types
  • UNLOCK.CI
    • Unlock.CI
Powered by GitBook
On this page
  • Create database
  • Get list of databases
  • Create table
  • Get list of tables in a database
  1. ACTIVE SYNC
  2. Data Ingestion API

Data Schema Warehouse API

Create database

Method: POST

Path:

https://[client].datainsider.co/api/ingestion/file/sync/history?from=0&size=10

Parameter
Type
Description

name

string

name of the table

display_name (optional)

string

name of the database displayed on the website

api_key

string

API key that has database permission

Sample request:

curl --request POST \
  --url https://[client].datainsider.co/api/databases \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "cccccccc-14a1-4eb1-8964-000000000000",
    "name": "[client]_db",
    "display_name": "[client] Database"
}'

Sample response:

{
  "name": "[client]_db",
  "organization_id": 0,
  "display_name": "[client] Database",
  "creator_id": "root",
  "created_time": 1645007956002,
  "updated_time": 1645007956002,
  "tables": []
}

Get list of databases

Method: POST

Path:

https://[client].datainsider.co/api/databases

Sample request:

curl --request GET \
  --url https://[client].datainsider.co/api/databases \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "cccccccc-14a1-4eb1-8964-000000000000"
}

Sample response:

[
    {
   	 "name": "analytics",
   	 "organization_id": 0,
   	 "display_name": "Analytics",
   	 "created_time": 1638464075069,
   	 "updated_time": 1638464075069
    },
    {
   	 "name": "KPI_DATABASE",
   	 "organization_id": 0,
   	 "display_name": "Kpi Database",
   	 "created_time": 1640866001362,
   	 "updated_time": 1640866001362
    },
    {
   	 "name": "[client]_db",
   	 "organization_id": 0,
   	 "display_name": "[client] Database",
   	 "creator_id": "root",
   	 "created_time": 1645007956002,
   	 "updated_time": 1645007956002
    }
]

Create table

Method: POST

Path:

https://[client].datainsider.co/api/databases/[client]_db/tables

Parameter
Type
Description

tbl_name

string

name of the table

db_name

string

name of the database that contains the table

api_key

string

API key that has database permission

columns

array<column>

columns of the table. The column of the table having the field class_name is an enum representing the data type of the column. List of supported data types: int32, uint32, int64, uint64, string, double, datetime.

Sample request:

curl --request POST \
  --url https://[client].datainsider.co/api/databases/<db_name>/tables \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "cccccccc-14a1-4eb1-8964-000000000000",
    "tbl_name": "user_transactions",
    "columns": [
    	{
    	"class_name": "uint64",
    	"name": "trans_id",
    	"display_name": "Transaction Id",
    	"is_nullable": true
  	},
  	{
    	"class_name": "string",
    	"name": "from_user",
    	"display_name": "From User",
    	"is_nullable": true
  	},
     	 {
    	"class_name": "string",
    	"name": "to_user",
    	"display_name": "To User",
    	"is_nullable": true
  	},
  	{
    	"class_name": "double",
    	"name": "amount",
    	"display_name": "Amount",
    	"is_nullable": true
  	},
  	{
    	"class_name": "datetime",
    	"name": "at_time",
    	"display_name": "At Time",
    	"is_nullable": true
  	},
  	{
    	"class_name": "bool",
    	"name": "is_success",
    	"display_name": "Is Success",
    	"is_nullable": true
  	}
    ]
}'

Sample response:

{
  "name": "user_transactions",
  "db_name": "[client]_db",
  "organization_id": 0,
  "display_name": "user_transactions",
  "columns": [
	{
  	"class_name": "uint64",
  	"name": "trans_id",
  	"display_name": "Transaction Id",
  	"is_nullable": true
	},
	{
  	"class_name": "string",
  	"name": "from_user",
  	"display_name": "From User",
  	"is_nullable": true
	},
	{
  	"class_name": "string",
  	"name": "to_user",
  	"display_name": "To User",
  	"is_nullable": true
	},
	{
  	"class_name": "double",
  	"name": "amount",
  	"display_name": "Amount",
  	"is_nullable": true
	},
	{
  	"class_name": "datetime",
  	"name": "at_time",
  	"display_name": "At Time",
  	"input_as_timestamp": false,
  	"input_formats": [],
  	"is_nullable": true
	},
	{
  	"class_name": "bool",
  	"name": "is_success",
  	"display_name": "Is Success",
  	"is_nullable": true
	}
  ],
  "primary_keys": [],
  "partition_by": [],
  "order_bys": [],
  "temporary": false
}

Get list of tables in a database

Method: GET

Path:

https://[client].datainsider.co/api/databases/<db_name>

Parameter
Type
Description

db_name

string

name of the database that contains the table

api_key

string

API key that has database permission

Sample request:

curl --request GET \
  --url https://[client].datainsider.co/api/databases/<db_name> \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "cccccccc-14a1-4eb1-8964-000000000000"
}'

Sample response:

{
  "name": "[client]_db",
  "organization_id": 0,
  "display_name": "[client] Database",
  "creator_id": "root",
  "created_time": 1645007956002,
  "updated_time": 1645007956002,
  "tables": [
{
  	"name": "user_transactions",
  	"db_name": "[client]_db",
  	"organization_id": 0,
  	"display_name": "user_transactions",
  	"columns": [
    	{
      	"class_name": "uint64",
      	"name": "trans_id",
      	"display_name": "Transaction Id",
      	"is_nullable": true
    	},
    	{
      	"class_name": "string",
      	"name": "from_user",
      	"display_name": "From User",
      	"is_nullable": true
    	},
    	{
      	"class_name": "string",
      	"name": "to_user",
      	"display_name": "To User",
      	"is_nullable": true
    	},
    	{
      	"class_name": "double",
      	"name": "amount",
      	"display_name": "Amount",
      	"is_nullable": true
    	},
    	{
      	"class_name": "datetime",
      	"name": "at_time",
      	"display_name": "At Time",
      	"input_as_timestamp": false,
      	"input_formats": [],
      	"is_nullable": true
    	},
    	{
      	"class_name": "bool",
      	"name": "is_success",
      	"display_name": "Is Success",
      	"is_nullable": true
    	}
  	],
  	"primary_keys": [],
  	"partition_by": [],
  	"order_bys": [],
  	"temporary": false
	}
  ]
}
PreviousTracking APINextData Integrations

Last updated 2 years ago