Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Knowledge Management REST API error

Daniel Arit
Tera Expert

Hi all,

Please offer support on the following situation:

I have set up the Knowledge Management REST API (I say I have done all the steps). When I try to 'POST' using a testing API tool to identify the Access Token for connection with a third-party application, I receive this error:

{
"error": {
"message": "User Not Authenticated",
"detail": "Required to provide Auth information"
},
"status": "failure"
}

 

The Service Account User is created, and has the necessary roles (I have created the sn_km_reader role and allocated it to the user), the snc_platform_rest_api_access role is assigned, and the knowledge role.

Note: The connection is set up to GET the knowledge management articles using the external application.

 

Please let me know if you have any suggestions for fixing this!

 

Thank you,

Daniel

2 ACCEPTED SOLUTIONS

As I dont know what API testing tool you use its hard for me to tell how its set up.

Postman for ex - then you set the auth method and enter the credentials - service account user name and password to be used when you integrate to ServiceNow - no matter the method

SimonChristens_0-1732534570036.png

 

View solution in original post

Hi Simon,

 

Yes, I'm using Postman too however I need to create a Service to Service connection.

Please see an article related to the steps that I've followed:

 

https://www.servicenow.com/community/developer-blog/oauth-2-0-with-inbound-rest/ba-p/2278926

 

https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/task/t...

 

DanielArit_0-1732560775070.png

DanielArit_1-1732560807802.png

I hope this will help!

Daniel

View solution in original post

6 REPLIES 6

Hi again,

Have you set up an Oauth Client in the environment?

SimonChristens_0-1732599613864.png

After that as well as the user account in SN

- In this sample i just created some variables in Postman and put in the information

SimonChristens_1-1732599713367.png

There shouldnt be done anything else to be able to generate an access_token that can then be used as a Baerer token

In addition - ServiceNow have provided some information about Oauth testing in Postman

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0822262 

Hi Simon,

 

Thank you very much for your help!

 

Those steps were done; however, today, I decided to delete the initial config and create a new one from scratch, and now the result is okay. I have retrieved the access token, and the knowledge articles can be accessed!

 

I appreciate your help!