Skip to content

Read Dataset

GET
/v2/datasets/read/{dataset_id}
curl --request GET \
--url 'http://localhost:3000/v2/datasets/read/example?mode=edit' \
--header 'Cookie: connect.sid=s%3AAYYroI28UhzQVPM909UpLjZlcqMlDMlZ.gAO6bTMTktZi7udh7jntL%2Bw2xVWiI1z6gsSAb3bhZp4'

This API allows you to read dataset from the requested dataset_id. User can request for the specific fields and status of the dataset through the request params. By default, the API returns the dataset of status “Live”. This API accepts the parameter mode=edit to read the draft dataset. If a draft dataset is not found, it creates one using the live dataset and returns the dataset details.

dataset_id
required
string

Unique identifier for the dataset

Cookie
string
Example
connect.sid=s%3AAYYroI28UhzQVPM909UpLjZlcqMlDMlZ.gAO6bTMTktZi7udh7jntL%2Bw2xVWiI1z6gsSAb3bhZp4
mode
string
Example
edit

OK

Media type application/json
object
Examples

Success: Read live dataset

{
"id": "api.datasets.read",
"ver": "v2",
"ts": "2024-07-17T17:38:55+05:30",
"params": {
"status": "SUCCESS",
"resmsgid": "8c8a2852-54bc-43fb-b063-7f359d11930a"
},
"responseCode": "OK",
"result": {
"dataset_id": "master-test",
"name": "master-test",
"type": "master",
"status": "Live",
"tags": [],
"version": 1,
"api_version": "v1",
"dataset_config": {
"data_key": "userid",
"timestamp_key": "",
"exclude_fields": [],
"entry_topic": "local.masterdata.ingest",
"redis_db_host": "localhost",
"redis_db_port": 6379,
"index_data": true,
"redis_db": 54
}
}
}
X-Powered-By
string
Example
Express
Content-Length
integer
Example
501
ETag
string
Example
W/"1f5-p+b/6r0nHRFhgr5+URzxk4d/CSg"
Date
string
Example
Wed, 17 Jul 2024 12:08:55 GMT
Connection
string
Example
keep-alive
Keep-Alive
string
Example
timeout=5

Bad Request

Media type application/json
object
Example
{
"id": "api.datasets.read",
"ver": "v2",
"ts": "2024-07-17T17:50:17+05:30",
"params": {
"status": "FAILED",
"resmsgid": "bccd40ad-db0a-4ed5-984c-e89a9d7b3fdd"
},
"responseCode": "BAD_REQUEST",
"result": {},
"error": {
"code": "DATASET_INVALID_FIELDS",
"message": "The specified fields [newname] in the dataset cannot be found."
}
}
X-Powered-By
string
Example
Express
Content-Length
integer
Example
307
ETag
string
Example
W/"133-TQ9WpmutsrDcTNkRRmbWOhUChMk"
Date
string
Example
Wed, 17 Jul 2024 12:20:17 GMT
Connection
string
Example
keep-alive
Keep-Alive
string
Example
timeout=5

Not Found

Media type application/json
object
Example
{
"id": "api.datasets.read",
"ver": "v2",
"ts": "2024-07-17T17:51:12+05:30",
"params": {
"status": "FAILED",
"resmsgid": "3aad3842-a76e-4fe8-b635-c7fef5f318f9"
},
"responseCode": "NOT_FOUND",
"result": {},
"error": {
"code": "DATASET_NOT_FOUND",
"message": "Dataset with the given dataset_id:new_telemetry_record.1 not found"
}
}
X-Powered-By
string
Example
Express
Content-Length
integer
Example
304
ETag
string
Example
W/"130-JL/oBB+GUHTrBp278giBHRvO71I"
Date
string
Example
Wed, 17 Jul 2024 12:21:12 GMT
Connection
string
Example
keep-alive
Keep-Alive
string
Example
timeout=5