Data In & Out APIs

List of APIs to write and read data

Data In (Write) API

The Data In APIs facilitate writing data into datasets, designed to simplify the ingestion of JSON data

Ingest Data

post
/v2/data/in/{dataset_id}
Path parameters
dataset_idstringRequired

Unique identifier for the dataset

Header parameters
Content-TypestringOptionalExample: application/json
Body
objectOptionalExample: {"id":"api.data.in","ver":"v2","ts":"1711966306164","params":{"msgid":"e180ecac-8f41-4f21-9a21-0b3a1a368917"},"data":{"eid":"INTERACT","date":"2022-01-01","ver":"3.0","syncts":1668591949682,"ets":1668591949682}}
Responses
200

OK

application/json
Responseobject
post
/v2/data/in/{dataset_id}

Data Out (Read) APIs

Use the Data Out APIs to fetch data from a dataset with support for SQL and Druid native query formats, suitable for analytics and visualization.

Query Data

post
/v2/data/query/{dataset_id}
Path parameters
dataset_idstringRequired

Unique identifier for the dataset

Body
objectOptionalExample: {"id":"api.data.out","ver":"v2","ts":"1711966306164","params":{"msgid":"e180ecac-8f41-4f21-9a21-0b3a1a368917"},"context":{"aggregationLevel":"day"},"query":"Select * from \"check\" WHERE __time >= timestamp '2020-12-31' AND __time < TIMESTAMP '2024-01-21' Limit 1"}
Responses
200

OK

application/json
Responseobject
post
/v2/data/query/{dataset_id}

Template APIs

The Template APIs enable efficient management of templates, including creating new templates, updating existing ones, listing all available templates, and retrieving metadata for specific templates. These APIs are designed to facilitate data retrieval from various sources using predefined template formats. They are particularly recommended for production environments where queries remain relatively static and do not require frequent changes.

List Templates

post
/v2/template/list
Body
objectOptionalExample: {"id":"api.query.template.list","ver":"v2","ts":"2024-04-10T16:10:50+05:30","params":{"msgid":"4a7f14c3-d61e-4d4f-be78-181834eeff6d"},"request":{"filters":{"query_type":"sql"},"sortBy":[{"field":"created_date","order":"desc"}]}}
Responses
200

OK

application/json
Responseobject
post
/v2/template/list
200

OK

Read Template

get
/v2/template/read/{template_id}
Path parameters
template_idstringRequired

Unique identifier for the template

Responses
200

OK

application/json
Responseobject
get
/v2/template/read/{template_id}

Update Template

patch
/v2/template/update/{template_id}
Path parameters
template_idstringRequired

Unique identifier for the template

Body
objectOptionalExample: {"id":"api.query.template.update","ver":"v2","ts":"2024-04-10T16:10:50+05:30","params":{"msgid":"4a7f14c3-d61e-4d4f-be78-181834eeff6d"},"request":{"template_name":"sql_update_test_template","query_type":"sql","query":"SELECT * FROM {{DATASET}} WHERE __time BETWEEN TIMESTAMP {{STARTDATE}} AND TIMESTAMP {{ENDDATE}} lIMIT {{LIMIT}}"}}
Responses
200

OK

application/json
Responseobject
patch
/v2/template/update/{template_id}

Query Template

post
/v2/template/query/{template_id}
Path parameters
template_idstringRequired

Unique identifier for the template

Body
objectOptionalExample: {"id":"api.query.template.query","ver":"v2","ts":"2024-04-10T16:10:50+05:30","params":{"msgid":"4a7f14c3-d61e-4d4f-be78-181834eeff6d"},"request":{"startdate":"2020-12-31","enddate":"2024-12-31","aggregationLevel":"month","dataset":"test","limit":5}}
Responses
200

OK

application/json
Responseobject
post
/v2/template/query/{template_id}

Delete Template

delete
/v2/template/delete/{template_id}
Path parameters
template_idstringRequired

Unique identifier for the template

Responses
200

OK

application/json
Responseobject
delete
/v2/template/delete/{template_id}