Categories

Get categories

GET /api/v1/categories

{
"data" : [
{
"name": "Elections",
"description": "",
"slug": "elections",
"parent": "",
"id": "5d7981c6bf1bce0001eda4f2",
"class": "com.factly.dega.domain.Category",
"clientId": "factly",
"createdDate": "2019-09-11T23:22:46.627Z",
"lastUpdatedDate": "2019-09-11T23:22:46.627Z"
},
{
...
},
....
],
"paging": {
"next": "eyIkdW5kZWZpbmVkIjp0cnVlfQ",
"hasNext": false,
"previous": "eyIkdW5kZWZpbmVkIjp0cnVlfQ",
"hasPrevious": false
}
}

Query paramaters

paramsvaluedescription
limitnumberTo limit number of categories
nextstringTo get next categories
previousstringTo get previous categories
sortBystringTo sort by field
sortAscbooleanTo sort by ascending

Get category

GET /api/v1/categories/:key

Path parameters

paramsdescription
keyTo get category by Object Id or slug

Get a particular category by Object Id

GET /api/v1/categories/$categoryId

{
"data" : {
"name": "Elections",
"description": "",
"slug": "elections",
"parent": "",
"id": "5d7981c6bf1bce0001eda4f2",
"class": "com.factly.dega.domain.Category",
"clientId": "factly",
"createdDate": "2019-09-11T23:22:46.627Z",
"lastUpdatedDate": "2019-09-11T23:22:46.627Z"
}
}

Get a particular category by slug

GET /api/v1/categories/$categorySlug

{
"data" : {
"name": "Elections",
"description": "",
"slug": "elections",
"parent": "",
"id": "5d7981c6bf1bce0001eda4f2",
"class": "com.factly.dega.domain.Category",
"clientId": "factly",
"createdDate": "2019-09-11T23:22:46.627Z",
"lastUpdatedDate": "2019-09-11T23:22:46.627Z"
}
}