https://[client].datainsider.co/api/databases/[client]_db/tables
Copy 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
}
]
}'
Copy {
"name": "user_transactions",
"db_name": "ingestion",
"organization_id": 0,
"display_name": "user_transactions",
"columns": [
{
"class_name": "uint64",
"name": "trans_id",
"display_name": "Transaction Id",
"is_nullable": true,
"is_encrypted": false
},
{
"class_name": "string",
"name": "from_user",
"display_name": "From User",
"is_nullable": true,
"is_encrypted": false
},
{
"class_name": "string",
"name": "to_user",
"display_name": "To User",
"is_nullable": true,
"is_encrypted": false
},
{
"class_name": "double",
"name": "amount",
"display_name": "Amount",
"is_nullable": true,
"is_encrypted": false
},
{
"class_name": "datetime",
"name": "at_time",
"display_name": "At Time",
"input_as_timestamp": false,
"input_formats": [],
"is_nullable": true,
"is_encrypted": false
},
{
"class_name": "bool",
"name": "is_success",
"display_name": "Is Success",
"is_nullable": true,
"is_encrypted": false
}
],
"primary_keys": [],
"partition_by": [],
"order_bys": [],
"table_type": "default",
"temporary": false
}
https://[client].datainsider.co/api/databases/[client]_db/tables
Copy curl --request POST \
--url http://[client].datainsider.co/api/ingestion/batch \
--header 'Content-Type: application/json' \
--data '{
"api_key": "cccccccc-14a1-4eb1-8964-000000000000",
"db_name": "ingestion",
"tbl_name": "user_transactions",
"records": [
[1, "John", "Marry", 123.45, "2020-01-08 00:01:00", true],
[2, "John", "Alex", 768.90, "2020-01-09 12:30:30", false],
[3, "Vi", "Tom", 123123.2, "2020-01-11 12:59:59", true],
[4, "Thuan", "Harley", 2134.0, "2020-01-11 23:00:06", false]
]
}'
Copy {
"total_records": 4,
"total_invalid_records": 0,
"total_invalid_fields": 0,
"total_skipped_records": 0,
"total_inserted_records": 4,
"total_failed_records": 0
}