This page shows some examples on how to use the dScribe API to query dses.
This endpoint will list your available dses. The query is paginated to the first 15 items. You can use the page and pageSize params to adjust this to your needs.
Copy const url = "https://{your_tenant}.dscribedata.com/api/dses";
const authToken = "yholmghj8§hbfg...";
fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
});
The response will look something like this.
Copy {
"metadata": {
"page": 1,
"pageSize": 20,
"total": 3,
"last_page": 1
},
"results": [
{
"id": "4030b7de-104f-4547-8d90-030def80c1cf",
"name": "dse",
"parent": "123",
"dataset_id": "42d5b4ca-7c57-4af7-bb4b-ba6f3d35ecd0",
"description": null,
"is_leaf": false,
"assets": ["123"],
"key_constraint": "primary"
},
{
"id": "2cec0d80-7477-400c-9297-ae69759cacd7",
"name": "test123",
"parent": "123",
"dataset_id": "27c87108-303a-4d29-815f-ab450190aa62",
"description": null,
"is_leaf": false,
"assets": ["123"],
"key_constraint": "secondary"
},
{
"id": "bf99b67e-2fdf-4823-82f7-6f518d142f7a-999340451",
"name": "Extract",
"parent": "123",
"dataset_id": "27c87108-303a-4d29-815f-ab450190aa62",
"description": null,
"is_leaf": false,
"assets": ["123"],
"key_constraint": null
}
]
}
If you want a bit more control on the dses that are returned, you can use the search endpoint. You can search on dataset_id (so the asset the dse is linked too), the parent DSE or the name.
Copy const url = "https://{your_tenant}.dscribedata.com/api/dses/search";
const authToken = "yholmghj8§hbfg...";
fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
data: JSON.stringify({
where: {
name_contains: "finance",
dataset_id: ["42d5b4ca-7c57-4af7-bb4b-ba6f3d35ecd0"],
parent: ["123"],
},
}),
});
For some integrations it might be useful to only fetch one asset.
Copy const url = "https://{your_tenant}.dscribedata.com/api/dses/:id";
const authToken = "yholmghj8§hbfg...";
fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
});
Copy {
"id": "4030b7de-104f-4547-8d90-030def80c1cf",
"name": "dse",
"parent": "123",
"dataset_id": "42d5b4ca-7c57-4af7-bb4b-ba6f3d35ecd0",
"description": null,
"is_leaf": false,
"assets": ["123"],
"key_constraint": "primary"
}