I have used Knowledge API to read the article from my instance with service account but some of the article are missed\not returning the Knowledge AOI?

Susilpa
Kilo Expert

Hi All,

Good Day.

I have the requirement to read all the knowledge articles from the instance by using the service account (web services only) and the account as ITIL & Knowledge roles.

So i gone through the servicenow documentation and used the knowledge API to fetch the details of knowledge articles from the instance for the certain key words (like vid issue).

Please refer the below is the Knowledge APi Call i have used

https://myinstancename.service-now.com/api/sn_km_api/knowledge/articles?query=vdi issue&fields=number,short_description,text,description&filter=language=en^workflow_state=published^valid_to>=javascript:gs.beginningOfToday()

But the api is not returning all the knowledge article as display as same from the service portal, in service portal with myself i'm able to see (pinned article too) but the api call is not returning the pinned articles.

Is there any restrictions which are causing the api to display the results by accessing through service account (webservices access only) or Admin user?.

Any help is appreciated in advance!.

 

Regards,

Kotaiah Sadari

 

 

 

 

1 REPLY 1

Jaron Stevenso1
Tera Contributor

Hello, I know this is an old question, but figured I'd write an answer just for future people who find this.

 

The /sn_km_api/knowledge/articles endpoint does not seem to be able to return the full content of the articles. Instead, you would have to make an additional call getting the specific article by ID (number or sys_id). Like: /sn_km_api/knowledge/articles/KB12345

 

At that point, the content should be contained in the response body at 'result.content'. If the knowledge article uses a template, content will be an array of each content containing field.

 

Here is a link to the full documentation for the REST API resource as well: https://docs.servicenow.com/bundle/vancouver-api-reference/page/integrate/inbound-rest/concept/knowl...