Append in Datasource

Endpoint Name: appenddatasource

Request type : POST

Authorization: Bearer token as header

Endpoint Details: The appenddatasourceendpoint will be used to append new data in datasource.

Method

URL

POST

URL/access/klearstack/appenddatasource

Request Body

Params

Values

Required

Description

datasource_name

string

Yes

Name of the datasource

company_name

string

Yes

Name of the company for which the user is logging in

data

string(JSON)

Yes

A valid JSON string containing info about Datasource to be created. It contains info about which columns to create and datatype of those columns

Example:

{

"DataSourceName": "test ",

"DataSourceType": "excel_or_csv",

"DataSourceStatus": true,

"fields": [{

"name": "USER_FIRST_NAME",

"datatype": "string"

}, {

"name": "email",

"datatype": "string"

}]

}

dataset

Binary

Yes

Excel or CSV file containing data for datasource.

Shell (cURL)

  • Request Body

curl --location "URL/access/klearstack/appenddatasource" \
  --header "Authorization: Bearer your_token_here" \
  --form "datasource_name=Replace_Datasource_Name_Here" \
  --form "company_name=Replace_Company_Name_Here" \
  --form 'data={
    "DataSourceName": "test",
    "DataSourceType": "excel_or_csv",
    "DataSourceStatus": true,
    "fields": [
      {"name": "USER_FIRST_NAME", "datatype": "string"},
      {"name": "email", "datatype": "string"}
    ]
  }' \
  --form "dataset=@path/to/your/file.csv"

Python

  • Request Body

Java (OkHttp)

  • Request Body

Node.js (Axios)

  • Request Body

JavaScript (XHR)

  • Request Body

API Response

Status code

Example Response

200

{

"success": true,

“release_version”:”7.8.9”

}

Last updated