List taxonomy

Requires authentication

HTTP Request

GET connector/api/taxonomy

Query Parameters

Parameter Status Description
type optional Type of taxonomy (product, device, hrm_department)

Example request:

curl -X GET \
-G "http://erp.dstadvertising.com/connector/api/taxonomy?type=sit" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Example response (200):

{
"data": [
{
"id": 1,
"name": "Men's",
"business_id": 1,
"short_code": null,
"parent_id": 0,
"created_by": 1,
"category_type": "product",
"description": null,
"slug": null,
"woocommerce_cat_id": null,
"deleted_at": null,
"created_at": "2018-01-03 21:06:34",
"updated_at": "2018-01-03 21:06:34",
"sub_categories": [
{
"id": 4,
"name": "Jeans",
"business_id": 1,
"short_code": null,
"parent_id": 1,
"created_by": 1,
"category_type": "product",
"description": null,
"slug": null,
"woocommerce_cat_id": null,
"deleted_at": null,
"created_at": "2018-01-03 21:07:34",
"updated_at": "2018-01-03 21:07:34"
},
{
"id": 5,
"name": "Shirts",
"business_id": 1,
"short_code": null,
"parent_id": 1,
"created_by": 1,
"category_type": "product",
"description": null,
"slug": null,
"woocommerce_cat_id": null,
"deleted_at": null,
"created_at": "2018-01-03 21:08:18",
"updated_at": "2018-01-03 21:08:18"
}
]
},
{
"id": 21,
"name": "Food & Grocery",
"business_id": 1,
"short_code": null,
"parent_id": 0,
"created_by": 1,
"category_type": "product",
"description": null,
"slug": null,
"woocommerce_cat_id": null,
"deleted_at": null,
"created_at": "2018-01-06 05:31:35",
"updated_at": "2018-01-06 05:31:35",
"sub_categories": []
}
]
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/taxonomy"
);
let params = {
"type": "sit",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));