The CreatorCon Call for Content is officially open! Get started here.

REST API user roles

Panagiotis Kons
Tera Expert

Hello,

 

I have created a new user in order to access the table API using REST calls. However I am not able to get any results, I can authenticate properly but the results returned are always empty (no results). If I add the user to group "Administrator" then everything is working fine, I can load the results with no problem. However this seems a bit too much. What are the roles/groups I need to assign to the user in order to be able to properly access the REST API?

 

I have Currently given the user the following roles:

 

rest_api_explorer

rest_service

web_service_admin

 

What else do I need to add?

 

Regards

 

Panos

1 ACCEPTED SOLUTION

Hi @Panagiotis Kons 

 

Might be helpful

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

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

9 REPLIES 9

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Panagiotis Kons 

 

1st role is good, try to give ITIL role too and check . Also check is any ACL

 

In addition to user authentication, each REST endpoint can have different requirements for the roles required to access the endpoint. Some require the admin role and others require API specific roles. Role requirements are specified in the access control list (ACL) associated with the REST API/endpoint.

 

 

However I am not able to get any results, I can authenticate properly but the results returned are always empty (no results)

Atul: How you are testing. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hello Kilo,

 

thank you for your prompt reply. However I tried both itil and itil_admin roles, they don't make any difference. I am testing using Postman, passing the username and password with basic authentication. I can connect fine, I get back the results but they are empty.

 

{
	"result": []
}

I am going to look at the ACLs for the specific table next. Meanwhile if you have any more thoughts please let me know.

 

Regards

 

Panos

Hi @Panagiotis Kons 

 

Might be helpful

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

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Thank you, it was an ACL issue indeed.

 

Regards

 

Panos