KB User's Guide - API - Categories
This document provides information on the Categories API for the KnowledgeBase.
Title
Get Categories
Calls externally-published categories (aka topics) for the specified site domain.
Collection Endpoint
https://[KB site domain]/[subsite (optional)]/api/v1/categories
Method
GET
URL Params
parameter | type | description |
---|---|---|
query | text string | one or more search terms, separated by a plus sign (+) |
Collection Sample Response
{ "_links": { "self": { "href": "https://kb.wisc.edu/uw-kb-demo/api/v1/categories" } }, "_embedded": { "category": [ { "id": 9579, "catName": "Lorem Ipsum", "children": [ { "id": 9581, "catName": "Edible Ipsum", "children": [ { "id": 9583, "catName": "Animal", "children": [] }, { "id": 9584, "catName": "Mineral", "children": [] }, { "id": 9585, "catName": "Vegetable", "children": [] } ] }, { "id": 9582, "catName": "Miscellaneous Ipsum", "children": [ { "id": 9586, "catName": "Fiction", "children": [] }, { "id": 9587, "catName": "Non-Fiction", "children": [] } ] } ], "_links": { "self": { "href": "https://kb.wisc.edu/uw-kb-demo/api/v1/categories/9579" } } }, { "id": 9580, "catName": "Sample Docs", "children": [], "_links": { "self": { "href": "https://kb.wisc.edu/uw-kb-demo/api/v1/categories/9580" } } } ] }, "total_items": 2 }
Entity Endpoint
/api/v1/categories/[category_id]
Example: /api/v1/categories/2134
Entity Sample Response
{ "id": "44", "parent_id": "3260", "level": "2", "cat_name": "Mac OS X", "cat_desc": "", "select_name": "Mac OS X", "int": "1", "ext": "1", "hot": "1", "active": "1", "_links": { "self": { "href": "https://kb.wisc.edu/helpdesk/api/v1/categories/44" } } }
Success Response
Code: 200 OK
Content: Content-type: application/hal+json
Error Response
Code: 403 Forbidden
Content: {"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","title":"Forbidden","status":403,"detail":"Forbidden"}
OR
Code: 404 Page Not Found
Content: Page not found.
OR
Code: 405 Method Not Allowed
Content: None
OR
Code: 500 Unexpected error
Content: { error : "Error producing an iterator" }
Notes
N/A