KB User's Guide - API - Articles

This document provides information in the Articles API for the KnowledgeBase.

Title

Get External Documents

Calls externally-published document content for the specified site domain.

Collection Endpoint

https://[KB site domain]/[subsite (optional)]/api/v1/articles

Example: https://kb.wisc.edu/api/v1/articles or https://kb.wisc.edu/helpdesk/api/v1/articles

** APIs are not enabled for institution subsites unless specifically requested. Please contact the KB team if you would like to request an API for your subsite(s).

Method

GET

URL Params

Note: All URL params are optional.

parameter type description
query text string one or more search terms, separated by a plus sign (plus sign)
catId integer ID number of an active topic
audId integer ID number of an active audience
exact integer 0 or undefined = fuzzy search (default)
1 = verbatim search
sort integer

If both sort and query are undefined, results will be sorted first by search priority, then by updated date (descending).

If query is supplied but sort is undefined, results will be sorted first by search priority, then by title match (descending), keywords match (descending), and summary match (descending). This default sort order for queries is referred to as "relevance".

1 = sort by id, ascending
2 = sort by id, descending
3 = sort by title, ascending
4 = sort by title, descending
5 = sort by updated date, ascending
6 = sort by updated date, descending
7 = sort by created date, ascending
8 = sort by created date, descending
9 = sort by reviewed date, ascending
10 = sort by reviewed date, descending
11 = sort by activation date, ascending
12 = sort by activation date, descending
13 = sort by expiration date, ascending
14 = sort by expiration date, descending
15 = sort by view count, ascending
16 = sort by view count, descending
17 = sort by owner group, ascending
18 = sort by owner group, descending
mode integer 0 or undefined = Keywords search (default)
1 = Fulltext search
2 = Attachments search
3 = Keywords plus Attachments search
4 = Fulltext plus Attachments search
ownerGroup string

If ownerGroup is undefined, results will include all documents available to the current group.

this = filter to docs owned by current group
other = filter to docs shared by other groups

Collection Sample Response

{
  "_links": {
    "self": {
      "href": "https://kb.wisc.edu/api/v1/articles?page=1"
    },
    "first": {
      "href": "https://kb.wisc.edu/api/v1/articles"
    },
    "last": {
      "href": "https://kb.wisc.edu/api/v1/articles?page=428"
    },
    "next": {
      "href": "https://kb.wisc.edu/api/v1/articles?page=2"
    }
  },
  "_embedded": {
    "article": [
      {
        "id": "5278",
        "title": "D2L - Getting Started",
        "keywords": "learn@uw learnuw desire2learn d2l tutorial manual introduction content navbar tool pedagogy",
        "summary": "The following narrated tutorials will help instructors and other course owners get started with a course in D2L at UW-Madison. Some components include click-along exercises, but you can also follow along when indicated below. The entire tutorial takes approximately 17 minutes (if this time commitment is too large, please use the printed \"Quick Reference\" or \"online checklist\" linked below).",
        "updated": "2017-03-16 18:03:20",
        "created": "2007-01-10 00:00:00",
        "reviewed": "2017-03-04 15:58:36",
        "activation": "2007-01-10 00:00:00",
        "expiration": "3000-01-01 00:00:00",
        "searchPriority": "1",
        "ownerGroup": "Learn@UW Mad",
        "views": "74300",
        "_links": {
          "self": {
            "href": "https://kb.wisc.edu/api/v1/articles/5278"
          }
        }
      },
      {
        "id": "1",
        "title": "Get Help from DoIT",
        "keywords": "DoIT help desk missions statement support policies statistics stats employment jobs satellite service desk hours operation walk in chat email walkin walk-in wihd dayton computer sciences comp sci hslc east campus mall up contacting us more information HD sd online helponline \"Level 2\" HDL2",
        "summary": "The DoIT Help Desk and Tech Store provide support to students, faculty, and staff at UW-Madison on general computing issues and various UW applications. The Help Desk provides support via phone, email and live chat. The Tech Store provides help in person at three service desk locations on campus.",
        "updated": "2017-03-08 22:02:58",
        "created": "2000-07-13 00:00:00",
        "reviewed": "2017-03-08 22:02:58",
        "activation": "2006-07-17 00:00:00",
        "expiration": "2017-09-08 22:03:10",
        "searchPriority": "1",
        "ownerGroup": "DoIT Help Desk",
        "views": "739561",
        "_links": {
          "self": {
            "href": "https://kb.wisc.edu/api/v1/articles/1"
          }
        }
      },

      ...

      }
    ]
  },
  "page_count": 428,
  "page_size": 25,
  "total_items": 10677,
  "page": 1
}

Entity Endpoint

/api/v1/articles/[doc_id]

Example: /api/v1/articles/69510

Entity Sample Response

{
  "id": "13905",
  "title": "What is the KnowledgeBase?",
  "keywords": "Knowledge base manage document information",
  "header": null,
  "alert": null,
  "summary": "The KnowledgeBase is a system for documenting and maintaining information for your staff and customers.  The KnowledgeBase is made up of many documents containing a wide variety of information.  ",
  "body": "<style type=\"text/css\"> \r\n  div.special {}\r\n  .special h4{margin-top:0px; margin-bottom:1px;}\r\n  .special h4.red{color:#CD9B9B; font-weight:bold;}\r\n  .special h4.right{align:right;}\r\n  .special p{margin-top:0px; margin-bottom:0px;}\r\n  .special ul{margin-top:0px; margin-bottom:1px;}\r\n  .special td{padding:10px;}\r\n</style>\r\n<div class=\"special\">\r\n<br />\r\n<h4>Manage Your Knowledge<br /><br /></h4>\r\n<p>The KnowledgeBase allows you to preserve, share, collaborate, and improve. </p>\r\n<br />\r\n  \r\n<table width=\"400\" cellpadding=\"10\">\r\n  \r\n<tbody>\r\n<tr>\r\n  \t\r\n<td style=\"background-color:#7198ca;\" valign=\"top\" align=\"left\">\r\n<h4>Preserve</h4>Document the knowledge essential to your operations.</td>\r\n    \r\n<td style=\"background-color:#eeeeee;\" valign=\"top\" align=\"left\">\r\n<h4 class=\"right\">Share</h4>Each partner site can share documentation with other partner sites.</td>\r\n  </tr>\r\n  \r\n<tr>\r\n  \t\r\n<td style=\"background-color:#eeeeee;\" valign=\"top\" align=\"left\">\r\n<h4>Collaborate</h4><span style=\"color:#505050\">Work with authors, partners, and your customers to improve your documentation.</span></td>\r\n    \r\n<td style=\"background-color:#7198ca;\" valign=\"top\" align=\"left\">\r\n<h4>Improve</h4>Once you have captured your knowledge, you can begin to improve your processes.</td>\r\n  </tr>\r\n  \r\n  </tbody></table><br />\r\n \r\n<br />\r\n<h4 style=\"color:#7198ca;\">Some examples of the type of information a KnowledgeBase document could contain are:</h4>\r\n<ul>\r\n<li>Employee policies</li>\r\n<li>Administrative procedures</li>\r\n<li>Technical Information</li>\r\n<li>Customer Information</li>\r\n</ul>\r\n\r\n<br />\r\n<h4 style=\"color:#7198ca;\">The KnowledgeBase can help you:</h4> \r\n<ul>\r\n<li>Communicate information to customers</li>\r\n<li>Consolidate scattered content</li>\r\n<li>Reduce training time for new staff</li>\r\n<li>Reduce redundancy by using shared content</li>\r\n<li>Prevent knowledge loss</li>\r\n</ul>\r\n\r\n<br />\r\n<h4 style=\"color:#7198ca;\">How does it work?</h4> \r\n<ul>\r\n<li>The KnowledgeBase is a web-based tool for managing your knowledge</li>\r\n<li>Each partner site has ability to control access to their content</li>\r\n<li>Document authors are automatically notified of aging documentation, which helps to keep content fresh</li>\r\n<li>Readers can submit vital feedback on your documentation</li>\r\n</ul>\r\n<div><br /></div>\r\n</div>",
  "footer": null,
  "owner": "Teresa A.",
  "updater": "Teresa A.",
  "created": "2010-04-28 00:00:00",
  "updated": "2017-01-05 19:22:45",
  "reviewed": "2017-01-05 19:22:45",
  "activation": "2010-04-28 00:00:00",
  "expiration": "2018-01-04 19:14:24",
  "ownerGroup": "KB Team",
  "_links": {
    "self": {
      "href": "https://kb.wisc.edu/api/v1/articles/13905"
    }
  }
}

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

See Also:




Keywords:restapi method url data params parameters success errors responses sample calls notes service documents docs active external   Doc ID:69510
Owner:Leah S.Group:KB User's Guide
Created:2016-12-15 15:01 CDTUpdated:2017-03-22 14:26 CDT
Sites:KB User's Guide
Feedback:  0   0