KB User's Guide - API - Top Articles

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

Title

Get Top Articles

Calls externally-published documents for the specified site domain ordered by page views.

Collection Endpoint

[KB site domain]/[subsite (optional)]/api/v1/top-articles

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

** 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)
ownerGroup string 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/top-articles?sort=16&page=1"
    },
    "first": {
      "href": "https://kb.wisc.edu/api/v1/top-articles?sort=16"
    },
    "last": {
      "href": "https://kb.wisc.edu/api/v1/top-articles?sort=16&page=1069"
    },
    "next": {
      "href": "https://kb.wisc.edu/api/v1/top-articles?sort=16&page=2"
    }
  },
  "_embedded": {
    "top_article": [
      {
        "id": "15141",
        "title": "Internet Explorer 9, 10 and 11 (Win) - Clearing Cache and Cookies",
        "keywords": "internet explorer 9 ie ie9 clear clearing remove removing cache cookies reset ie10 10 ie11 11",
        "summary": "This document explains how to clear the cache and cookies in Internet Explorer 9, 10 and 11.",
        "updated": "2016-08-08 20:20:15",
        "created": "2010-09-27 00:00:00",
        "reviewed": "2016-12-07 22:04:06",
        "activation": "2009-09-30 00:00:00",
        "expiration": "2017-06-05 00:00:00",
        "searchPriority": "3",
        "ownerGroup": "DoIT Help Desk",
        "views": "2057157",
        "_links": {
          "self": {
            "href": "https://kb.wisc.edu/api/v1/top-articles/15141"
          }
        }
      },
      {
        "id": "4927",
        "title": "Intel, AMD & ARM Processors",
        "keywords": "personal departmental processor comparison intel pentium celeron core duo dual centrino dell apple mac cpu amd Ghz amd turion athlon sempron phenom i3 i5 i7 nehalem sandy bridge arm amd 32bit 64bit",
        "summary": "An overview of notebook and desktop processors offered by Intel and AMD, brief coverage given to ARM whose processors are found in tablets and smartphones.",
        "updated": "2017-01-31 18:03:46",
        "created": "2006-08-18 00:00:00",
        "reviewed": "2017-01-31 18:03:46",
        "activation": "2006-08-18 00:00:00",
        "expiration": "2017-07-31 18:03:49",
        "searchPriority": "3",
        "ownerGroup": "DoIT Tech Store",
        "views": "1582571",
        "_links": {
          "self": {
            "href": "https://kb.wisc.edu/api/v1/top-articles/4927"
          }
        }
      },

      ...

      }
    ]
  },
  "page_count": 1069,
  "page_size": 10,
  "total_items": 10683,
  "page": 1
}

Entity Endpoint

/api/v1/top-articles/[doc_id]

Example: /api/v1/top-articles/3

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 most viewed documents doc pages hit count   Doc ID:71628
Owner:Leah S.Group:KB User's Guide
Created:2017-03-10 14:23 CDTUpdated:2017-03-22 14:24 CDT
Sites:KB User's Guide
Feedback:  0   0