- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2020 11:04 AM
Hi All,
I have been looking for an API for creating knowledge article in Service Now with article state as "Publish".
I have tried Table API and can create a article in Draft state, but I want the article to be in Publish state so that the created article can be seen during knowledge search. Can someone guide me what are the steps to create and publish and article using API ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2020 01:16 PM
Hi
Best to jump-start on working with the ServiceNow API is to use the "REST API Explorer", which you can find by navigating to:
> System Wen Services > REST > REST API Explorer
THe screenshot above shows the "REST API Explorer" (1).
Select the "now" Namespace (2), The "API Name" set to "Table API" (3) and take the "API Version" to "latest" (4).
This will allow to select any table to use in the "tableName" field (5).
Select the "kb_knowledge" table and play arround with the API-.
Note:
Such TestDrives are ALWAYS only recommended to do on NON-Production instances!
When you are fine with testing, scroll down to the bottom of the screen and click on the "[ServiceNow Script]" link, which will open a popup windows with a code snippet to call the API.
If you are not familiar with REST APIs at all, I recommend to consult the ServiceNow Docs Online for basic consulting.
When writing Records to the KB this way, you will be able to create the records in the state that you want to. You will not need to run any workflow. Just write the records as needed to that target table.
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2020 12:59 PM
Hi,
I don't know much about the API side of things - but couldn't you use the 'Instant Publish' workflow to get the Article to Draft? Or utilise a Flow Designer flow, oncreate, that changes the status of the article?
Cheers
Carl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 12:12 AM
Thanks Carl, for the suggestion, I wanted to do it using API calls. I have to make two table API calls, one for creating the article and other for Publishing it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2020 01:16 PM
Hi
Best to jump-start on working with the ServiceNow API is to use the "REST API Explorer", which you can find by navigating to:
> System Wen Services > REST > REST API Explorer
THe screenshot above shows the "REST API Explorer" (1).
Select the "now" Namespace (2), The "API Name" set to "Table API" (3) and take the "API Version" to "latest" (4).
This will allow to select any table to use in the "tableName" field (5).
Select the "kb_knowledge" table and play arround with the API-.
Note:
Such TestDrives are ALWAYS only recommended to do on NON-Production instances!
When you are fine with testing, scroll down to the bottom of the screen and click on the "[ServiceNow Script]" link, which will open a popup windows with a code snippet to call the API.
If you are not familiar with REST APIs at all, I recommend to consult the ServiceNow Docs Online for basic consulting.
When writing Records to the KB this way, you will be able to create the records in the state that you want to. You will not need to run any workflow. Just write the records as needed to that target table.
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 12:15 AM
Thanks Dirk,
As suggested I have created two scripted rest APIs with table API calls, one for creating the article and other for Publishing it. And using them in my custom component.