<h2>Knowledge Management REST API</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2024" /><meta name="DC.rights.owner" content="(C) Copyright 2024" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="concept" /><meta name="DC.title" content="Knowledge Management REST API" /><meta name="abstract" content="The Knowledge Management REST API enables searching, viewing, and fetching lists of the most-viewed and featured knowledge articles." /><meta name="description" content="The Knowledge Management REST API enables searching, viewing, and fetching lists of the most-viewed and featured knowledge articles." /><meta name="DC.subject" content="Knowledge Management REST API" /><meta name="keywords" content="Knowledge Management REST API" /><meta name="DC.relation" scheme="URI" content="../../../build/applications/concept/api-rest.html" /><meta name="DC.relation" scheme="URI" content="../../../build/applications/concept/api-implementation-reference.html" /><meta name="DC.relation" scheme="URI" content="../../../build/applications/concept/api-reference.html" /><meta name="DC.creator" content="David Miller" /><meta name="DC.creator" content="Mark Moulder" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2023-08-03" /><meta name="page-type" content="platform" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="knowledge-api" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Knowledge Management REST API</title></head><body> <div class="nested0" id="knowledge-api"> <h1 class="title topictitle1" id="ariaid-title1">Knowledge Management REST API</h1> <div class="body conbody"><p class="shortdesc">The <span class="keyword apiname">Knowledge Management</span> REST API enables searching, viewing, and fetching lists of the most-viewed and featured knowledge articles.</p> <p class="p">This API can only be used when the Knowledge API (sn_km_api) plugin is activated. The <span class="keyword apiname">Knowledge Management REST API</span> was originally released in <span class="ph">Orlando</span> using the Knowledge API app available in the <span class="ph">ServiceNow Store</span>.</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> The <span class="keyword apiname">Knowledge Management REST API</span> is publicly accessible and makes any knowledge base that is publicly accessible available to all users, including unauthenticated users. For version 1.0.1 and later, the API was made editable, allowing admins to configure each endpoint to disallow unauthenticated access by selecting the <span class="ph uicontrol">Requires Authentication</span> flag on the Scripted REST Service Security tab associated with the API.</div> </div> <p class="p">To enable other domains to use <span class="keyword apiname">Knowledge Management REST API</span> endpoints, define a Cross-Origin Resource Sharing (CORS) rule. For more information, see <a class="xref" href="../task/t_DefineACORSRule.html" title="You can define a CORS rule to control which domains can access specific REST API endpoints.">Define a CORS rule</a>.</p> <p class="p">To view an article from the scoped knowledge base using this REST API, allow the sn_km_api scope read access from the requesting scope in the Restricted Caller Access Privileges [sys_restricted_caller_access] table. For more information, see <a class="xref" href="../build/applications/task/set-RCA-level.dita/set-RCA-level.html" target="_blank" rel="noopener noreferrer">Define cross-scope access to an application resource</a>.</p> <p class="p">By default, this API has a rate limit of 500 per hour for unauthenticated and snc_external users. For more information about rate limiting, see <a class="xref" href="inbound-REST-API-rate-limiting.html" title="To prevent excessive inbound REST API requests, set rules that limit the number of inbound REST API requests processed per hour. You can create rules to limit requests for specific users, users with specific roles, or all users.">Inbound REST API rate limiting</a>.</p> </div> <div class="related-links"> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="../../../build/applications/concept/api-rest.html" title="Use REST interfaces to access data on your instance.">REST API reference</a></div> </div> </div><div class="topic reference nested1 rest_api_endpoint" id="knowledge-GET-articles"> <h2 class="title topictitle2" id="ariaid-title2">Knowledge Management - GET /knowledge/articles</h2> <div class="body refbody"><p class="shortdesc">Returns a list of knowledge base (KB) articles which can be searched and filtered using various parameters.</p> <div class="section"></div> <div class="section" id="knowledge-GET-articles__section_anz_bcv_1mb"><h3 class="title sectiontitle">URL format</h3> <p class="p rest_api_versioned_url">Versioned URL: <span class="ph filepath">/api/sn_km_api/{api_version}/knowledge/articles</span></p> <p class="p rest_api_default_url">Default URL: <span class="ph filepath">/api/sn_km_api/knowledge/articles</span></p> </div> <div class="section"><h3 class="title sectiontitle">Supported request parameters</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_path_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>Path parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e213">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e216">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e213 ">api_version</td><td class="entry cellrowborder" id="knowledge-GET-articles__version-entry-RESTAPI" style="vertical-align:top;" headers="d837687e216 "><span class="ph" id="knowledge-GET-articles__version-RESTAPI">Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.</span> <p class="p">Data type: String</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_query_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 2. </span>Query parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e260">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e263">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">filter</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 "><span class="ph">Encoded query to use to filter the result set. </span> <p class="p">Syntax: <code class="ph codeph">filter=<attr><operator><value></code>.</p> <ul class="ul" id="knowledge-GET-articles__ul_aj4_rpt_xkb"><li class="li"><code class="ph codeph"><attr></code>: Name of the table column.</li><li class="li"><code class="ph codeph"><operator></code>: <div class="p" id="knowledge-GET-articles__reuse_encoded_query_vals">Valid values:<ul class="ul" id="knowledge-GET-articles__ul_zkb_jpy_mgb"><li class="li">=: Exactly matches <value>.</li><li class="li">!=: Does not match <value>.</li><li class="li">^: Enables you to specify more than one condition and logically AND them.</li><li class="li">^OR: Enables you to specify more than one condition and logically OR them.</li><li class="li">LIKE: <attr> contains the specified string. Only works for <attr> fields whose data type is string.</li><li class="li">STARTSWITH: <attr> starts with the specified string. Only works for <attr> fields whose data type is string.</li><li class="li">ENDSWITH: <attr> ends with the specified string. Only works for <attr> fields whose data type is string.</li></ul> </div> </li><li class="li"><code class="ph codeph"><value></code>: Value to match against.</li></ul> <p class="p"><span class="ph">All parameters are case-sensitive. Query can contain more than one entry, such as</span> <code class="ph codeph">filter=<attr><operator><value>[<operator><attr><operator><value>]</code>.</p> <p class="p">Data type: String</p> <p class="p">Default: empty</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 ">Comma-separated list of fields from the Knowledge [kb_knowledge] table to show details in results.<p class="p">Data type: String</p> <p class="p">Default: None</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">kb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 ">Comma-separated list of knowledge base sys_ids from the Knowledge Bases [kb_knowledge_base] table to restrict results to.<p class="p">Data type: String</p> </td></tr><tr id="knowledge-GET-articles__km-api-parm-lang" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 ">List of comma-separated languages in two-letter ISO 639-1 language code format to restrict results to. Alternatively type 'all' to search in all valid installed languages on an instance.<p class="p">Data type: String</p> <p class="p">Default: User's session language or en</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">limit</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 ">Maximum number of records to return. Unusually large <span class="keyword parmname">limit</span> values can impact system performance. For requests that exceed this number of records, use the <span class="keyword parmname">offset</span> parameter to paginate record retrieval.<p class="p">Data type: Number</p> <p class="p">Default: 30</p> </td></tr><tr id="knowledge-GET-articles__km-api-parm-off" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">offset</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 "><span class="ph">Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.</span> <p class="p">For example, the first time this endpoint is called, <span class="keyword parmname">offset</span> is set to "0". To page through all available records, use <code class="ph codeph">offset=offset+limit</code> until the end of the all records is reached.</p> <p class="p">Data type: Number</p> <p class="p">Default: 0</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e260 ">query</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e263 ">Text to search for, can be empty.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_body" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 3. </span>Request body parameters (XML or JSON)</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e458">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e461">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e458 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e461 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_headers"><h3 class="title sectiontitle">Headers</h3> <p class="p">The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">Supported REST API headers</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 4. </span>Request headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e510">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e513">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e510 ">Accept</td><td class="entry cellrowborder" id="knowledge-GET-articles__accept-entry-RESTAPI" style="vertical-align:top;" headers="d837687e513 "><span class="ph" id="knowledge-GET-articles__accept-RESTAPI">Data format of the response body. Supported types: <span class="keyword parmname">application/json</span> or <span class="keyword parmname">application/xml</span>.</span> <p class="p">Default: <span class="keyword parmname">application/json</span></p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_response_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 5. </span>Response headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry row-nocellborder" style="vertical-align:top;" id="d837687e559">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e562">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d837687e559 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e562 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_status_codes"><h3 class="title sectiontitle">Status codes</h3> <p class="p">The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">REST API HTTP response codes</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 6. </span>Status codes</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e611">Status code</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e614">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e611 ">200</td><td class="entry cellrowborder" id="knowledge-GET-articles__entry-200-status-code" style="vertical-align:top;" headers="d837687e614 ">Successful. The request was successfully processed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e611 ">401</td><td class="entry cellrowborder" id="knowledge-GET-articles__entry-401-status-code" style="vertical-align:top;" headers="d837687e614 ">Unauthorized. The user credentials are incorrect or haven't been passed.</td></tr><tr id="knowledge-GET-articles__row-500-status-code" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e611 ">500</td><td class="entry cellrowborder" id="knowledge-GET-articles__entry-500-status-code" style="vertical-align:top;" headers="d837687e614 ">Internal server error. An unexpected error occurred while processing the request.</td></tr></tbody></table> </div> </div> <div class="section rest-api-response-body"><h3 class="title sectiontitle">Response body parameters (JSON or XML)</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e670">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e673">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">List of articles returned in response.<p class="p">Data type: Array</p> <pre class="pre codeblock"><code>"articles": [ { "fields": {Object}, "link": "String", "id": "String", "number": "String", "rank": Number, "score": Number, "snippet": "String", "title": "String" } ]</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields</td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fields" style="vertical-align:top;" headers="d837687e673 ">Values of requested fields, if any.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"fields": { "<field_name>": {Object} }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields.<field_name></td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fields_fieldname" style="vertical-align:top;" headers="d837687e673 ">Lists each field requested using the fields parameter, if any.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"<field_name>": { "display_value": "String", "label": "String", "name": "String", "type": "String", "value": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields.<field_name>.display_value</td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fieldName-display" style="vertical-align:top;" headers="d837687e673 ">Display value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields.<field_name>.label</td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fieldName-label" style="vertical-align:top;" headers="d837687e673 ">Label representing the requested field. For example, <samp class="ph systemoutput">Knowledge</samp>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields.<field_name>.name</td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fieldName-name" style="vertical-align:top;" headers="d837687e673 ">Name of the requested field. Matches <span class="keyword parmname"><field_name></span>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields.<field_name>.type</td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fieldName-type" style="vertical-align:top;" headers="d837687e673 ">Data type of requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.fields.<field_name>.value</td><td class="entry cellrowborder" id="knowledge-GET-articles__km-resp-fields-fieldName-val" style="vertical-align:top;" headers="d837687e673 ">Value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.id</td><td class="entry cellrowborder" id="knowledge-GET-articles__km_kb_id" style="vertical-align:top;" headers="d837687e673 ">Knowledge article sys_id from the Knowledge [kb_knowledge] table.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.link</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Link to the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Knowledge article number.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.rank</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Search rank of article specific to this search.<p class="p">Data type: Number (Float)</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.snippet</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Text showing a small portion of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.score</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Relevancy score, results sorted in descending order by score.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">articles.title</td><td class="entry cellrowborder" id="knowledge-GET-articles__km_kb_sdesc" style="vertical-align:top;" headers="d837687e673 ">Short description or title of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Meta information of the results and request parameters.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"meta": { "count": Number, "end": Number, "fields": "String", "filter": "String", "kb": "String", "language": "String", "query": "String", "start": Number, "status": {Object}, "ts_query_id": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.count</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Number of available KB articles.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.end</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Ending index of the result set.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Fields in the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.filter</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Filter used to acquire the data.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.kb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">List of knowledge base article sys_ids.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">List of comma-separated languages of the KB articles that were requested.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.query</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Specified request query.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.start</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Starting index of result set.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.status</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Status of the call.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e670 ">meta.ts_query_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e673 ">Sys_id of the query.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> </div> <div class="example rest_api_curl_example"><h3 class="title sectiontitle">cURL request</h3> <pre lang="curl" class="pre codeblock"><code>curl "https://instance.servicenow.com/api/sn_km_api/knowledge/articles?query=Windows&limit=2&fields=short_description&fields=sys_class_name" \ --request GET \ --header "Accept:application/xml" \ --user "username":"password"</code></pre> <pre lang="json" class="pre codeblock"><code>{ "result": { "meta": { "start": 0, "end": 2, "fields": "short_description,sys_class_name", "query": "Windows", "filter": "", "kb": "", "language": "en", "count": 19, "ts_query_id": "7976f36129c30410f877796e70786991", "status": { "code": 200 } }, "articles": [ { "link": "?sys_kb_id=9e528db1474321009db4b5b08b9a71a6&id=kb_article_view&sysparm_rank=1&sysparm_tsqueryId=7976f36129c30410f877796e70786991", "rank": 1, "id": "kb_knowledge:9e528db1474321009db4b5b08b9a71a6", "title": "Windows: Should I upgrade to Windows 8.x?", "snippet": " Should I upgrade to <B>Windows</B> 8.x? <B>Windows</B> 8.x is designed for using touch, mouse, and keyboard the <B>Windows</B> Store and access apps such as Calendar, Mail, and Messaging. By most accounts, <B>Windows</B> boot times, smaller memory footprint, and more free memory for the programs you run. <B>Windows</B>", "score": 14.869, "number": "KB0000020", "fields": { "short_description": { "display_value": "Windows: Should I upgrade to Windows 8.x?\n\t\t", "name": "short_description", "label": "Short description", "type": "string", "value": "Windows: Should I upgrade to Windows 8.x?\n\t\t" }, "sys_class_name": { "display_value": "Knowledge", "name": "sys_class_name", "label": "Class", "type": "sys_class_name", "value": "kb_knowledge" } } }, { "link": "?sys_kb_id=3b07857187032100deddb882a2e3ec20&id=kb_article_view&sysparm_rank=2&sysparm_tsqueryId=7976f36129c30410f877796e70786991", "rank": 2, "id": "kb_knowledge:3b07857187032100deddb882a2e3ec20", "title": "What is the Windows key?", "snippet": "What is the <B>Windows</B> key? The <B>Windows</B> key is a standard key on most keyboards on computers built to use a <B>Windows</B> operating system. It is labeled with a <B>Windows</B> logo, and is usually placed between on the right side as well. Pressing Win (the <B>Windows</B> key) on its own will do the following: <B>Windows</B> 8.x: Toggle", "score": 13.4826, "number": "KB0000017", "fields": { "short_description": { "display_value": "What is the Windows key?\t\t", "name": "short_description", "label": "Short description", "type": "string", "value": "What is the Windows key?\t\t" }, "sys_class_name": { "display_value": "Knowledge", "name": "sys_class_name", "label": "Class", "type": "sys_class_name", "value": "kb_knowledge" } } } ] } } </code></pre> </div> </div> </div> <div class="topic reference nested1 rest_api_endpoint" id="knowledge-GET-articles-attachments"> <h2 class="title topictitle2" id="ariaid-title3">Knowledge Management - GET /knowledge/articles/{article_sys_id}/attachments/{attachment_sys_id}</h2> <div class="body refbody"><p class="shortdesc">Returns a knowledge article attachment as a file.</p> <div class="section" id="knowledge-GET-articles-attachments__section_rsz_rc4_bmb"><h3 class="title sectiontitle">URL format</h3> <p class="p rest_api_versioned_url">Versioned URL: <span class="ph filepath">/api/sn_km_api/{api_version}/knowledge/articles/{article_sys_id}/attachments/{attachment_sys_id}</span></p> <p class="p rest_api_default_url">Default URL: <span class="ph filepath">/api/sn_km_api/knowledge/articles/{article_sys_id}/attachments/{attachment_sys_id}</span></p> </div> <div class="section"><h3 class="title sectiontitle">Supported request parameters</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_path_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 7. </span>Path parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1073">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1076">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1073 ">api_version</td><td class="entry cellrowborder" id="knowledge-GET-articles-attachments__version-entry-RESTAPI" style="vertical-align:top;" headers="d837687e1076 "><span class="ph" id="knowledge-GET-articles-attachments__version-RESTAPI">Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.</span> <p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1073 ">article_sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1076 ">Sys_id of the knowledge article with the attachment you intend to retrieve. Located in the Knowledge Bases [kb_knowledge] table.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1073 ">attachment_sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1076 ">Sys_id of record to which the attachment belongs.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_query_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 8. </span>Query parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1142">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1145">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1142 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1145 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_body" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 9. </span>Request body parameters (XML or JSON)</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1178">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1181">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1178 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1181 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_headers"><h3 class="title sectiontitle">Headers</h3> <p class="p">The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">Supported REST API headers</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 10. </span>Request headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1230">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1233">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1230 ">Accept</td><td class="entry cellrowborder" id="knowledge-GET-articles-attachments__accept-entry-RESTAPI" style="vertical-align:top;" headers="d837687e1233 "><span class="ph" id="knowledge-GET-articles-attachments__accept-RESTAPI">Data format of the response body. Supported types: <span class="keyword parmname">application/json</span> or <span class="keyword parmname">application/xml</span>.</span> <p class="p">Default: <span class="keyword parmname">application/json</span></p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_response_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 11. </span>Response headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry row-nocellborder" style="vertical-align:top;" id="d837687e1279">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1282">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d837687e1279 ">Content-Type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1282 ">The content type of the response, for example, image/gif or */*.</td></tr></tbody></table> </div> </div> <div class="section rest_api_status_codes"><h3 class="title sectiontitle">Status codes</h3> <p class="p">The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">REST API HTTP response codes</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 12. </span>Status codes</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1338">Status code</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1341">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1338 ">200</td><td class="entry cellrowborder" id="knowledge-GET-articles-attachments__entry-200-status-code" style="vertical-align:top;" headers="d837687e1341 ">Successful. The request was successfully processed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1338 ">401</td><td class="entry cellrowborder" id="knowledge-GET-articles-attachments__entry-401-status-code" style="vertical-align:top;" headers="d837687e1341 ">Unauthorized. The user credentials are incorrect or haven't been passed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1338 ">404</td><td class="entry cellrowborder" id="knowledge-GET-articles-attachments__entry-404-status-code" style="vertical-align:top;" headers="d837687e1341 ">Not found. The requested item wasn't found.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1338 ">500</td><td class="entry cellrowborder" id="knowledge-GET-articles-attachments__entry-500-status-code" style="vertical-align:top;" headers="d837687e1341 ">Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.</td></tr></tbody></table> </div> </div> <div class="section rest-api-response-body"><h3 class="title sectiontitle">Response body parameters</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1405">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1408">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1405 ">File is returned as a response.</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1408 "> </td></tr></tbody></table> </div> </div> <div class="example rest_api_curl_example"><h3 class="title sectiontitle">Sample cURL request</h3> <pre lang="curl" class="pre codeblock"><code>curl "https://instance.service-now.com/api/sn_km_api/knowledge/articles/0b48fd75474321009db4b5b08b9a71c2/attachments/fedf5614294f4010f877796e70786956" \ --request GET \ --header "Accept:*/*" \ --user "username":"password"</code></pre> <pre lang="xml" class="pre codeblock"><code>Binary response not shown (file is returned as a response).</code></pre> </div> </div> </div> <div class="topic reference nested1 rest_api_endpoint" id="knowledge-GET-articles-featured"> <h2 class="title topictitle2" id="ariaid-title4">Knowledge Management - GET /knowledge/articles/featured</h2> <div class="body refbody"><p class="shortdesc">Returns a list of the most-viewed knowledge articles and featured knowledge articles.</p> <div class="section" id="knowledge-GET-articles-featured__section_ayw_2gv_1mb"><h3 class="title sectiontitle">URL format</h3> <p class="p rest_api_versioned_url">Versioned URL: <span class="ph filepath">/api/sn_km_api/{api_version}/knowledge/articles/featured</span></p> <p class="p rest_api_default_url">Default URL: <span class="ph filepath">/api/sn_km_api/knowledge/articles/featured</span></p> </div> <div class="section"><h3 class="title sectiontitle">Supported request parameters</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_path_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 13. </span>Path parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1510">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1513">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1510 ">api_version</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__version-entry-RESTAPI" style="vertical-align:top;" headers="d837687e1513 "><span class="ph" id="knowledge-GET-articles-featured__version-RESTAPI">Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.</span> <p class="p">Data type: String</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_query_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 14. </span>Query parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1557">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1560">Description</th></tr></thead><tbody class="tbody"><tr id="knowledge-GET-articles-featured__km-api-parm-fields" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1557 ">fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1560 ">Comma-separated list of fields from the Knowledge [kb_knowledge] table to show details in results.<p class="p">Data type: String</p> <p class="p">Default: None</p> </td></tr><tr id="knowledge-GET-articles-featured__km-api-parm-kb" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1557 ">kb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1560 ">Comma-separated list of knowledge base sys_ids from the Knowledge Bases [kb_knowledge_base] table to restrict results to.<p class="p">Data type: String</p> </td></tr><tr id="knowledge-GET-articles-featured__km-api-parm-lang" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1557 ">language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1560 ">List of comma-separated languages in two-letter ISO 639-1 language code format to restrict results to. Alternatively type 'all' to search in all valid installed languages on an instance.<p class="p">Data type: String</p> <p class="p">Default: User's session language or en</p> </td></tr><tr id="knowledge-GET-articles-featured__km-api-parm-limit" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1557 ">limit</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1560 ">Maximum number of records to return. Unusually large <span class="keyword parmname">limit</span> values can impact system performance. For requests that exceed this number of records, use the <span class="keyword parmname">offset</span> parameter to paginate record retrieval.<p class="p">Data type: Number</p> <p class="p">Default: 30</p> </td></tr><tr id="knowledge-GET-articles-featured__km-api-parm-off" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1557 ">offset</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1560 "><span class="ph">Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.</span> <p class="p">For example, the first time this endpoint is called, <span class="keyword parmname">offset</span> is set to "0". To page through all available records, use <code class="ph codeph">offset=offset+limit</code> until the end of the all records is reached.</p> <p class="p">Data type: Number</p> <p class="p">Default: 0</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_body" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 15. </span>Request body parameters (XML or JSON)</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1669">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1672">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1669 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1672 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_headers"><h3 class="title sectiontitle">Headers</h3> <p class="p">The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">Supported REST API headers</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 16. </span>Request headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1721">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1724">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1721 ">Accept</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__accept-entry-RESTAPI" style="vertical-align:top;" headers="d837687e1724 "><span class="ph" id="knowledge-GET-articles-featured__accept-RESTAPI">Data format of the response body. Supported types: <span class="keyword parmname">application/json</span> or <span class="keyword parmname">application/xml</span>.</span> <p class="p">Default: <span class="keyword parmname">application/json</span></p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_response_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 17. </span>Response headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry row-nocellborder" style="vertical-align:top;" id="d837687e1770">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1773">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d837687e1770 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1773 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_status_codes"><h3 class="title sectiontitle">Status codes</h3> <p class="p">The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">REST API HTTP response codes</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 18. </span>Status codes</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1822">Status code</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1825">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1822 ">200</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__entry-200-status-code" style="vertical-align:top;" headers="d837687e1825 ">Successful. The request was successfully processed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1822 ">401</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__entry-401-status-code" style="vertical-align:top;" headers="d837687e1825 ">Unauthorized. The user credentials are incorrect or haven't been passed.</td></tr><tr id="knowledge-GET-articles-featured__row-500-status-code" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1822 ">500</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__entry-500-status-code" style="vertical-align:top;" headers="d837687e1825 ">Internal server error. An unexpected error occurred while processing the request.</td></tr></tbody></table> </div> </div> <div class="section rest-api-response-body"><h3 class="title sectiontitle">Response body parameters (JSON or XML)</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1880">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e1883">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">List of articles returned in response.<p class="p">Data type: Array</p> <pre class="pre codeblock"><code>"articles":[ { "fields": {Object}, "id": "String", "link": "String", "number": "String", "rank": Number, "score": Number, "snippet": "String", "title": "String" } ]</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fields" style="vertical-align:top;" headers="d837687e1883 ">Values of requested fields, if any.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"fields": { "<field_name>": {Object} }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields.<field_name></td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fields_fieldname" style="vertical-align:top;" headers="d837687e1883 ">Lists each field requested using the fields parameter, if any.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"<field_name>": { "display_value": "String", "name": "String", "label": "String", "type": "String", "value": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields.<field_name>.display_value</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fieldName-display" style="vertical-align:top;" headers="d837687e1883 ">Display value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields.<field_name>.name</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fieldName-name" style="vertical-align:top;" headers="d837687e1883 ">Name of the requested field. Matches <span class="keyword parmname"><field_name></span>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields.<field_name>.label</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fieldName-label" style="vertical-align:top;" headers="d837687e1883 ">Label representing the requested field. For example, <samp class="ph systemoutput">Knowledge</samp>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields.<field_name>.type</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fieldName-type" style="vertical-align:top;" headers="d837687e1883 ">Data type of requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.fields.<field_name>.value</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km-resp-fields-fieldName-val" style="vertical-align:top;" headers="d837687e1883 ">Value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.id</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km_kb_id" style="vertical-align:top;" headers="d837687e1883 ">Knowledge article sys_id from the Knowledge [kb_knowledge] table.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.link</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Link to the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Knowledge article number.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.rank</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Search rank of article specific to this search.<p class="p">Data type: Number (Float)</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.score</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Relevancy score, results sorted in descending order by score.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.snippet</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Text showing a small portion of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">articles.title</td><td class="entry cellrowborder" id="knowledge-GET-articles-featured__km_kb_sdesc" style="vertical-align:top;" headers="d837687e1883 ">Short description or title of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Meta information of the results and request parameters.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"meta": { "count": Number, "end": Number, "fields": "String", "filter": "String", "kb": "String", "language": "String", "query": "String", "start": Number, "status": {Object}, "ts_query_id": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.count</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Number of available KB articles.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.end</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Ending index of the result set.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Fields in the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.filter</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Filter used to acquire the data.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.kb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">List of knowledge base article sys_ids.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">List of comma-separated languages of the KB articles that were requested.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.query</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Specified request query.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.start</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Starting index of result set.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.status</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">HTTP status of the call.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1880 ">meta.ts_query_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e1883 ">Sys_id of the query.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> </div> <div class="example rest_api_curl_example"><h3 class="title sectiontitle">cURL request</h3> <pre lang="curl" class="pre codeblock"><code>curl "https://instance.servicenow.com/api/sn_km_api/knowledge/articles/featured?fields=short_description&limit=3" \ --request GET \ --header "Accept:application/json" \ --user "username":"password"</code></pre> <pre lang="json" class="pre codeblock"><code>{ "result": { "meta": { "start": 0, "end": 3, "fields": "short_description", "query": "homepage", "filter": "", "kb": "", "language": "en", "status": { "code": 200 }, "count": 2 }, "articles": [ { "link": "?id=kb_article_view&sys_kb_id=f27d7f79c0a8011b0018f9d700d2b9aa", "id": "kb_knowledge:f27d7f79c0a8011b0018f9d700d2b9aa", "title": "Email Interruption Tonight at 11:00 PM Eastern", "snippet": " If the site is UP but you cant access the page, try one of the below solutions: Browser Related Problems Force a full refresh for the site. This can be achieved by pressing CTRL + F5 keys at the same time on your favourite browser (Firefox, Chrome, Explorer, etc.) Try alternative urls such as m.outlook.com Clear the temporary cache and cookies ", "score": -1, "number": "KB0000002", "fields": { "short_description": { "display_value": "Email Interruption Tonight at 11:00 PM Eastern\n\t\t", "name": "short_description", "label": "Short description", "type": "string", "value": "Email Interruption Tonight at 11:00 PM Eastern\n\t\t" } } }, { "link": "?id=kb_article_view&sys_kb_id=f2765f9fc0a8011b0120ec1b352bf09b", "id": "kb_knowledge:f2765f9fc0a8011b0120ec1b352bf09b", "title": "Sales Force Automation is DOWN", "snippet": " On Friday, January 20th, we experienced a widespread outage that affected all Zoho services. The outage started around 8:13 am Pacific Time. Zoho services started coming back online for customer use at 3:49 pm, and all services were fully restored at 6:22 pm PST. We absolutely realize how important our services are for businesses and users who", "score": -1, "number": "KB0000001", "fields": { "short_description": { "display_value": "Sales Force Automation is DOWN", "name": "short_description", "label": "Short description", "type": "string", "value": "Sales Force Automation is DOWN" } } } ] } } </code></pre> </div> </div> </div> <div class="topic reference nested1 rest_api_endpoint" id="knowledge-GET-articles-id"> <h2 class="title topictitle2" id="ariaid-title5">Knowledge Management - GET /knowledge/articles/{id}</h2> <div class="body refbody"><p class="shortdesc">Returns specific knowledge article content and its field values.</p> <div class="section" id="knowledge-GET-articles-id__section_tx3_phv_1mb"><h3 class="title sectiontitle">URL format</h3> <p class="p rest_api_versioned_url">Versioned URL: <span class="ph filepath">/api/sn_km_api/{api_version}/knowledge/articles/{id}</span></p> <p class="p rest_api_default_url">Default URL: <span class="ph filepath">/api/sn_km_api/knowledge/articles/{id}</span></p> </div> <div class="section"><h3 class="title sectiontitle">Supported request parameters</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_path_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 19. </span>Path parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2284">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2287">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2284 ">api_version</td><td class="entry cellrowborder" id="knowledge-GET-articles-id__version-entry-RESTAPI" style="vertical-align:top;" headers="d837687e2287 "><span class="ph" id="knowledge-GET-articles-id__version-RESTAPI">Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.</span> <p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2284 ">id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2287 ">Sys_id or knowledge base (KB) number of a knowledge article in the Knowledge [kb_knowledge] table.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_query_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 20. </span>Query parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2342">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2345">Description</th></tr></thead><tbody class="tbody"><tr id="knowledge-GET-articles-id__km-api-parm-fields" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2342 ">fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2345 ">Comma-separated list of fields from the Knowledge [kb_knowledge] table to show details in results.<p class="p">Data type: String</p> <p class="p">Default: None</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2342 ">language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2345 ">Two letter ISO 639-1 language code; for example, "fr" for French. Results display only when searches use the knowledge article KB number as the <span class="keyword parmname">id</span> and a translated version of the article is available in the language specified.<div class="p"><div class="note"><span class="notetitle">Note:</span> Only valid when setting the <span class="keyword parmname">id</span> parameter as a KB number (not sys_id).</div> </div> <p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2342 ">search_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2345 ">Optional unless using <span class="keyword parmname">search_rank</span>. Unique identifier of search that returned this article.<div class="p">You can retrieve <span class="keyword parmname">search_id</span> using one of the following APIs that returns the <span class="keyword parmname">articles.id</span> element:<ul class="ul" id="knowledge-GET-articles-id__ul_g5c_1v1_ykb"><li class="li"><a class="xref" href="knowledge-api.html#knowledge-GET-articles" title="Returns a list of knowledge base (KB) articles which can be searched and filtered using various parameters.">Knowledge Management - GET /knowledge/articles</a></li><li class="li"><a class="xref" href="knowledge-api.html#knowledge-GET-articles-featured" title="Returns a list of the most-viewed knowledge articles and featured knowledge articles.">Knowledge Management - GET /knowledge/articles/featured</a></li><li class="li"><a class="xref" href="knowledge-api.html#knowledge-GET-articles-most-viewed" title="Returns a list of knowledge articles prioritized by most-viewed.">Knowledge Management - GET knowledge/articles/most_viewed</a></li></ul> </div> <p class="p">Passing the <span class="keyword parmname">search_id</span> and <span class="keyword parmname">search_rank</span> parameter increments the article view count and records an entry for the article in the Knowledge Use [kb_use] table. You can also verify incremented view counts in Knowledge Base [kb_view2] page.</p> <p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2342 ">search_rank</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2345 ">Optional unless using <span class="keyword parmname">search_id</span>. Article <a class="xref" href="../administer/search-administration/concept/c_DocumentScoring.dita/c_DocumentScoring.html" target="_blank" rel="noopener noreferrer">search rank</a> by click-rate that you can retrieve using one of the following APIs that returns the <span class="keyword parmname">articles.rank</span> element:<div class="p"><ul class="ul" id="knowledge-GET-articles-id__ul_bhl_zt1_ykb"><li class="li"><a class="xref" href="knowledge-api.html#knowledge-GET-articles" title="Returns a list of knowledge base (KB) articles which can be searched and filtered using various parameters.">Knowledge Management - GET /knowledge/articles</a></li><li class="li"><a class="xref" href="knowledge-api.html#knowledge-GET-articles-featured" title="Returns a list of the most-viewed knowledge articles and featured knowledge articles.">Knowledge Management - GET /knowledge/articles/featured</a></li><li class="li"><a class="xref" href="knowledge-api.html#knowledge-GET-articles-most-viewed" title="Returns a list of knowledge articles prioritized by most-viewed.">Knowledge Management - GET knowledge/articles/most_viewed</a></li></ul> </div> <p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2342 ">update_view</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2345 ">Update view count and record an entry for the article in the Knowledge Use [kb_use] table. True whether present as a standalone parameter or set to true. <div class="note"><span class="notetitle">Note:</span> If you pass <span class="keyword parmname">update_view</span> with <span class="keyword parmname">search_id</span> and <span class="keyword parmname">search_rank</span>, <span class="keyword parmname">update_view</span> is ignored because the view count will already be incremented.</div> <p class="p">Data type: Boolean that is always handled as true when passed whether set to "true", "false", or not set at all.</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_body" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 21. </span>Request body parameters (XML or JSON)</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2544">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2547">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2544 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2547 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_headers"><h3 class="title sectiontitle">Headers</h3> <p class="p">The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">Supported REST API headers</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 22. </span>Request headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2596">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2599">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2596 ">Accept</td><td class="entry cellrowborder" id="knowledge-GET-articles-id__accept-entry-RESTAPI" style="vertical-align:top;" headers="d837687e2599 "><span class="ph" id="knowledge-GET-articles-id__accept-RESTAPI">Data format of the response body. Supported types: <span class="keyword parmname">application/json</span> or <span class="keyword parmname">application/xml</span>.</span> <p class="p">Default: <span class="keyword parmname">application/json</span></p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_response_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 23. </span>Response headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry row-nocellborder" style="vertical-align:top;" id="d837687e2645">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2648">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d837687e2645 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2648 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_status_codes"><h3 class="title sectiontitle">Status codes</h3> <p class="p">The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">REST API HTTP response codes</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 24. </span>Status codes</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2697">Status code</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2700">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2697 ">200</td><td class="entry cellrowborder" id="knowledge-GET-articles-id__entry-200-status-code" style="vertical-align:top;" headers="d837687e2700 ">Successful. The request was successfully processed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2697 ">401</td><td class="entry cellrowborder" id="knowledge-GET-articles-id__entry-401-status-code" style="vertical-align:top;" headers="d837687e2700 ">Unauthorized. The user credentials are incorrect or haven't been passed.</td></tr><tr id="knowledge-GET-articles-id__row-500-status-code" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2697 ">500</td><td class="entry cellrowborder" id="knowledge-GET-articles-id__entry-500-status-code" style="vertical-align:top;" headers="d837687e2700 ">Internal server error. An unexpected error occurred while processing the request.</td></tr></tbody></table> </div> </div> <div class="section rest-api-response-body"><h3 class="title sectiontitle">Response body parameters (JSON or XML)</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2755">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e2758">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">attachments</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Provides attachment details for each instance if attachment exists.<p class="p">Only displays if <code class="ph codeph">display_attachments = true</code>.</p> <p class="p">Data type: Array</p> <pre class="pre codeblock"><code>"attachments": [ { "file_name": "String", "size_bytes": "String", "state": "String", "sys_id": "String" } ]</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">attachments.file_name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">File name of attachment.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">attachments.size_bytes</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">File size.<p class="p">Data type: String</p> <p class="p">Unit: Bytes</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">attachments.state</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">State.<div class="p">Possible values: <ul class="ul" id="knowledge-GET-articles-id__ul_ipc_gc3_3mb"><li class="li">available</li><li class="li">available_conditionally</li><li class="li">not_available</li><li class="li">pending</li></ul> </div> <p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">attachments.sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Sys_id of the attachment.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">content</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Entire HTML content of the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">display_attachments</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Flag that indicates whether the <span class="keyword parmname">display_attachments</span> flag is active for that article. Attachments are returned only if <span class="keyword parmname">display_attachments</span> is true (active) in the knowledge article record.<ul class="ul" id="knowledge-GET-articles-id__ul_ftq_lws_xkb"><li class="li">true: <span class="keyword parmname">display_attachments</span> is active.</li><li class="li">false: <span class="keyword parmname">display_attachments</span> is inactive.</li></ul> <p class="p">Data type: Boolean</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">embedded_content</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Lists each attachment containing embedded content by sys_id and includes relevant attachment information.<p class="p">Only displays if <code class="ph codeph">display_attachments = true</code>.</p> <p class="p">Data type: Array</p> <pre class="pre codeblock"><code>"attachments": [ { "file_name": "String", "size_bytes": "String", "state": "String", "sys_id": "String" } ]</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">embedded_content.file_name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">File name of the attachment.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">embedded_content.size_bytes</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Size of the attachment.<p class="p">Data type: String</p> <p class="p">Unit: Bytes</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">embedded_content.state</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">State of the attachment. <div class="p">Possible values: <ul class="ul" id="knowledge-GET-articles-id__ul_zd1_zvv_mmb"><li class="li">available</li><li class="li">available_conditionally</li><li class="li">not_available</li><li class="li">pending</li></ul> </div> <p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">embedded_content.sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Sys_id of the attachment.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Values of requested fields (if any).<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"fields": { "<field_name>": {Object} }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields.<field_name></td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Lists each field requested using the fields parameter, if any.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"<field_name>": { "display_value": "String", "label": "String", "name": "String", "type": "String", "value": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields.<field_name>.display_value</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Display value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields.<field_name>.label</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Label representing the requested field. For example, <samp class="ph systemoutput">Knowledge</samp>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields.<field_name>.name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Name of the requested field. Matches <span class="keyword parmname"><field_name></span>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields.<field_name>.type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Data type of requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">fields.<field_name>.value</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Two-letter ISO 639-1 language code for the current article (if translation is available).<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">languages</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">For each translated version of a knowledge article (if translated):<pre class="pre codeblock"><code>"languages": [ { "label": "String", "language": "String", "sys_id": "String" } ]</code></pre> <p class="p">Data type: Array</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">languages.label</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">String representation for language.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">languages.language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Two-letter ISO 639-1 code language.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">languages.sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Unique identifier for translated version of knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Article number.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">short_description</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Short description or title of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">sys_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Knowledge article sys_id from the Knowledge [kb_knowledge] table.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">template</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Flag that indicates whether a returned article is a template.<div class="p">Possible values:<ul class="ul" id="knowledge-GET-articles-id__ul_e3d_gws_xkb"><li class="li">true: Article is a template.</li><li class="li">false: Article is not a template.</li></ul> </div> <p class="p">Data type: Boolean</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2755 ">template_table</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e2758 ">Name of template table, only returns if knowledge article is a template.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> </div> <div class="example rest_api_curl_example"><h3 class="title sectiontitle">cURL request</h3> <pre lang="curl" class="pre codeblock"><code>curl "https://instance.servicenow.com/api/sn_km_api/knowledge/articles/0b48fd75474321009db4b5b08b9a71c2?search_id=spam&search_rank=26.426" \ --request GET \ --header "Accept:application/json" \ --user "username":"password"</code></pre> <pre lang="json" class="pre codeblock"><code>{ "result": { "content": "<p><span style=\"font-size: 18pt;\"><strong>How to Deal with Spam</strong></span></p>\r\n<p>Spam has increasingly become a problem on the Internet. While every Internet user receives some spam, email addresses posted to web sites or in newsgroups and chat rooms attract the most spam.</p>\r\n<p>To reduce the amount of spam you receive:</p>\r\n<p> "template": false, "number": "KB0000011", "sys_id": "0b48fd75474321009db4b5b08b9a71c2", "short_description": "How to Deal with Spam", "display_attachments": true, "attachments": [ { "sys_id": "dc27ae18294f4010f877796e707869c8", "file_name": "image.jpg", "size_bytes": "66792", "state": "available_conditionally" }, { "sys_id": "fedf5614294f4010f877796e70786956", "file_name": "attachment.txt", "size_bytes": "75", "state": "available_conditionally" } ], "embedded_content": [] } }</code></pre> </div> <div class="example rest_api_curl_example"><h3 class="title sectiontitle">Sample cURL request (update_view)</h3> <pre lang="curl" class="pre codeblock"><code>curl "https://instance.servicenow.com/api/sn_km_api/knowledge/KB0000020?update_view=' \ --request GET \ --header "Accept:application/json" \ --user "username":"password"</code></pre> <pre lang="json" class="pre codeblock"><code>{ "result": { "content": "<p> </p>\r\n<p> </p>\r\n<p><strong><span style=\"font-size: 18pt;\">Should I upgrade to Windows 8.x?</span></strong></p>\r\n<p>Windows 8.x is designed for using touch, mouse, and keyboard together, on hardware ranging from touch-enabled tablets and laptops to PCs and all-in-one computers...(intentionally truncated)</p>", "template": false, "number": "KB0000020", "sys_id": "9e528db1474321009db4b5b08b9a71a6", "short_description": "Windows: Should I upgrade to Windows 8.x?\t\t", "display_attachments": true, "attachments": [], "embedded_content": [] } }</code></pre> </div> </div> </div> <div class="topic reference nested1 rest_api_endpoint" id="knowledge-GET-articles-most-viewed"> <h2 class="title topictitle2" id="ariaid-title6">Knowledge Management - GET knowledge/articles/most_viewed</h2> <div class="body refbody"><p class="shortdesc">Returns a list of knowledge articles prioritized by most-viewed.</p> <div class="section" id="knowledge-GET-articles-most-viewed__section_apz_541_bmb"><h3 class="title sectiontitle">URL format</h3> <p class="p rest_api_versioned_url">Versioned URL: <span class="ph filepath">/api/sn_km_api/{api_version}/knowledge/articles/most_viewed</span></p> <p class="p rest_api_default_url">Default URL: <span class="ph filepath">/api/sn_km_api/knowledge/articles/most_viewed</span></p> </div> <div class="section"><h3 class="title sectiontitle">Supported request parameters</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_path_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 25. </span>Path parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3292">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3295">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3292 ">api_version</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3295 "><span class="ph" id="knowledge-GET-articles-most-viewed__version-RESTAPI">Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.</span> <p class="p">Data type: String</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_query_parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 26. </span>Query parameters</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3339">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3342">Description</th></tr></thead><tbody class="tbody"><tr id="knowledge-GET-articles-most-viewed__km-api-parm-fields" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3339 ">fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3342 ">Comma-separated list of fields from the Knowledge [kb_knowledge] table to show details in results.<p class="p">Data type: String</p> <p class="p">Default: None</p> </td></tr><tr id="knowledge-GET-articles-most-viewed__km-api-parm-kb" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3339 ">kb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3342 ">Comma-separated list of knowledge base sys_ids from the Knowledge Bases [kb_knowledge_base] table to restrict results to.<p class="p">Data type: String</p> </td></tr><tr id="knowledge-GET-articles-most-viewed__km-api-parm-lang" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3339 ">language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3342 ">List of comma-separated languages in two-letter ISO 639-1 language code format to restrict results to. Alternatively type 'all' to search in all valid installed languages on an instance.<p class="p">Data type: String</p> <p class="p">Default: User's session language or en</p> </td></tr><tr id="knowledge-GET-articles-most-viewed__km-api-parm-limit" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3339 ">limit</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3342 ">Maximum number of records to return. Unusually large <span class="keyword parmname">limit</span> values can impact system performance. For requests that exceed this number of records, use the <span class="keyword parmname">offset</span> parameter to paginate record retrieval.<p class="p">Data type: Number</p> <p class="p">Default: 30</p> </td></tr><tr id="knowledge-GET-articles-most-viewed__km-api-parm-off" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3339 ">offset</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3342 "><span class="ph">Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.</span> <p class="p">For example, the first time this endpoint is called, <span class="keyword parmname">offset</span> is set to "0". To page through all available records, use <code class="ph codeph">offset=offset+limit</code> until the end of the all records is reached.</p> <p class="p">Data type: Number</p> <p class="p">Default: 0</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_body" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 27. </span>Request body parameters (XML or JSON)</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3451">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3454">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3451 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3454 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_headers"><h3 class="title sectiontitle">Headers</h3> <p class="p">The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">Supported REST API headers</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_request_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 28. </span>Request headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3503">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3506">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3503 ">Accept</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__accept-entry-RESTAPI" style="vertical-align:top;" headers="d837687e3506 "><span class="ph" id="knowledge-GET-articles-most-viewed__accept-RESTAPI">Data format of the response body. Supported types: <span class="keyword parmname">application/json</span> or <span class="keyword parmname">application/xml</span>.</span> <p class="p">Default: <span class="keyword parmname">application/json</span></p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table rest_api_response_headers" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 29. </span>Response headers</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry row-nocellborder" style="vertical-align:top;" id="d837687e3552">Header</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3555">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d837687e3552 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3555 "> </td></tr></tbody></table> </div> </div> <div class="section rest_api_status_codes"><h3 class="title sectiontitle">Status codes</h3> <p class="p">The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see <a class="xref" href="c_RESTAPI.html" title="REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.">REST API HTTP response codes</a>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 30. </span>Status codes</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3604">Status code</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3607">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3604 ">200</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__entry-200-status-code" style="vertical-align:top;" headers="d837687e3607 ">Successful. The request was successfully processed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3604 ">401</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__entry-401-status-code" style="vertical-align:top;" headers="d837687e3607 ">Unauthorized. The user credentials are incorrect or haven't been passed.</td></tr><tr id="knowledge-GET-articles-most-viewed__row-500-status-code" class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3604 ">500</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__entry-500-status-code" style="vertical-align:top;" headers="d837687e3607 ">Internal server error. An unexpected error occurred while processing the request.</td></tr></tbody></table> </div> </div> <div class="section rest-api-response-body"><h3 class="title sectiontitle">Response body parameters (JSON or XML)</h3> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="border" border="1" rules="all"><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3662">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d837687e3665">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">List of articles returned in response.<p class="p">Data type: Array</p> <pre class="pre codeblock"><code>[ { "fields": {Object}, "id": "String", "link": "String", "number": "String", "rank": Number, "score": Float, "snippet": "String", "title": "String" } ]</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fields" style="vertical-align:top;" headers="d837687e3665 ">Values of requested fields (if any).<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"fields": { "<field_name>": {Object} }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields.<field_name></td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fields_fieldname" style="vertical-align:top;" headers="d837687e3665 ">Lists each field requested using the fields parameter, if any.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"<field_name>": { "display_value": "String", "label": "String", "name": "String", "type": "String", "value": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields.<field_name>.display_value</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fieldName-display" style="vertical-align:top;" headers="d837687e3665 ">Display value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields.<field_name>.label</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fieldName-label" style="vertical-align:top;" headers="d837687e3665 ">Label representing the requested field. For example, <samp class="ph systemoutput">Knowledge</samp>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields.<field_name>.name</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fieldName-name" style="vertical-align:top;" headers="d837687e3665 ">Name of the requested field. Matches <field_name>.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields.<field_name>.type</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fieldName-type" style="vertical-align:top;" headers="d837687e3665 ">Data type of requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.fields.<field_name>.value</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km-resp-fields-fieldName-val" style="vertical-align:top;" headers="d837687e3665 ">Value of the requested field.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.id</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km_kb_id" style="vertical-align:top;" headers="d837687e3665 ">Knowledge article sys_id from the Knowledge [kb_knowledge] table.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.link</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Link to the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Knowledge article number.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.rank</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Search rank of article specific to this search.<p class="p">Data type: Float</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.score</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Relevancy score, results sorted in descending order by score.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.snippet</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Text showing a small portion of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">articles.title</td><td class="entry cellrowborder" id="knowledge-GET-articles-most-viewed__km_kb_sdesc" style="vertical-align:top;" headers="d837687e3665 ">Short description or title of the knowledge article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Meta information of the results and request parameters.<p class="p">Data type: Object</p> <pre class="pre codeblock"><code>"meta": { "count": Number, "end": Number, "fields": "String", "filter": "String", "kb": "String", "language": "String", "query": "String", "start": Number, "status": {Object}, "ts_query_id": "String" }</code></pre></td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.count</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Number of available KB articles.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.end</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Ending index of the result set.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.fields</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Fields in the article.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.filter</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Filter used to acquire the data.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.kb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">List of knowledge base article sys_ids.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.language</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">List of comma-separated languages of the KB articles that were requested.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.query</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Specified request query.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.start</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Starting index of result set.<p class="p">Data type: Number</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.status</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">HTTP status of the call.<p class="p">Data type: String</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3662 ">meta.ts_query_id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d837687e3665 ">Sys_id of the query.<p class="p">Data type: String</p> </td></tr></tbody></table> </div> </div> <div class="example rest_api_curl_example"><h3 class="title sectiontitle">cURL request</h3> <pre lang="curl" class="pre codeblock"><code>curl "https://instance.servicenow.com/api/sn_km_api/knowledge/articles/most_viewed?limit=5" \ --request GET \ --header "Accept:application/json" \ --user "username":"password"</code></pre> <pre lang="json" class="pre codeblock"><code>{ "result": { "meta": { "start": 0, "end": 5, "fields": "", "query": "", "filter": "workflow_state=published^valid_to>=javascript:gs.beginningOfToday()^active=true^sys_class_name!=kb_knowledge_block^sys_view_count>0^ORDERBYDESCsys_view_count^ORDERBYshort_description", "kb": "", "count": 2, "status": { "code": 200 }, "language": "en" }, "articles": [ { "link": "?id=kb_article_view&sys_kb_id=0b48fd75474321009db4b5b08b9a71c2", "id": "kb_knowledge:0b48fd75474321009db4b5b08b9a71c2", "title": "How to Deal with Spam", "snippet": "How to Deal with Spam Spam has increasingly become a problem on the Internet. While every Internet user receives some spam, email addresses posted to web sites or in newsgroups and chat rooms attract the most spam. To reduce the amount of spam you receive: Don't reply to spam Be careful releasing your email address, and know how it will be used ", "score": 7, "tags": [], "number": "KB0000011" }, { "link": "?id=kb_article_view&sys_kb_id=c85cd2519f77230088aebde8132e70c2", "id": "kb_knowledge:c85cd2519f77230088aebde8132e70c2", "title": "Microsoft Outlook Issues", "snippet": "Microsoft Outlook Issues This article explains how to use automatic replies in Outlook 2010 for Exchange accounts. Setting Up Automatic Replies Click the File tab. Click Automatic Replies. Select Send automatic replies. If desired, select the Only send during this time range check box to schedule when your out of office replies are active. If yo", "score": 6, "tags": [], "number": "KB99999999" } ] } }</code></pre> </div> </div> </div> </div> </body></html></div>