How to access knowledge based in SN from REST API

wakespirit
Kilo Guru

Dear all,http:<

I need from an external application to access ServcieNow knowledge based article.

What is the URL I should initiate a GET in order to retriev that list ? I would like to test it first from GOOGLE ARC tool

http://<my servicenow>/???/<Table> ???

Thanks for your help

regards

1 ACCEPTED SOLUTION

If there is a one to one relation with the article then you could fetch data from the related table using the REST API. For eg Configuration item - it is related to the article and you could fetch data from the CI. 

If the relation is from a different table, then you need send a second query on the other table and fetch the details.

Refer to this post and you can see on how to dot walk:  https://community.servicenow.com/community?id=community_blog&sys_id=49fda22ddbd0dbc01dcaf3231f9619cf&view_source=searchResult

GET /api/now/table/incident?sysparm_limit=1&sysparm_fields=number%2Clocation%2Clocation.name%2Clocation.city

View solution in original post

7 REPLIES 7

Alikutty A
Tera Sage

Hello,

You can try this out, Please use REST API explorer in Service Now, it is a very useful tool to test out your Rest queries.

GET https://instance_name.service-now.com/api/now/table/kb_knowledge/sys_id_of_article.

Thanks!

Screenshots from Rest API explore on how you could test it

find_real_file.png

 

 

Great thanks.

So if I undertsnad well SN web services are available by default to external app as long as you know the endpoint.

But if I test it outside REST API explorer, lilke google ARC for instance are they public API or do I need to provide a USer name password available in SN  ?

 

In addition to that, if I need to use REST API in order to make a search of knowledge based article based on criteria ( quite similar as google does ) ? what is the url and parameter syntax to use if I need to collect all knowledge based article which contains the word "Computer" ?

thnaks for help

You could access the data as long as you know the REST endpoint and have a valid user ID and password in the instance. The credentials are required to authorize you at the endpoint. 

If you need to filter your queries then you need to include them in a parameter called sysparm_query 

So your new endpoint will be


GET https://instance_name.service-now.com/api/now/table/kb_knowledge?sysparm_query=short_descriptionLIKEComputer

 

If you have any further queries let me know or If have answered your query, Please mark the correct answer.

Thanks!