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.

How to grant read access to Task table via REST API?

mkader
Kilo Guru

Hello,

We have a user requesting read access to the Task table via REST API. How can this be achieved? Our task table is already flagged to true for "Allow access to this table via web services".

find_real_file.png

He also mentioned he only needs to send GET requests to pull data out of ServiceNow. 

Thanks!

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Just set up a user account, web service access only, and add a role which can read the task table.

The you could use an Endpoint like:
https://your-instance.service-now.com/api/now/table/task

You can also add parameters, to get a certain number of records, only certain fields, apply a query, etc.. Play around with this using the REST API Explorer on your instance.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

8 REPLIES 8

If you use that checkbox yes.

If you are using that user account also to actually use the GUI, then don't use that checkbox.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Awesome! Thanks again for your help!

henrry
Tera Contributor

That's correct. This means the user will only be able to make requests to the API, but won't be able to log in to the portal using the standard username and password method. And it is a good practice to actually do this (creating a user specifically for web services, rather than using a regular user account).

 

P.S. I know this response is a bit late, but I'm leaving it here in case others come across the same question.

you need to check the web service check box in sys_user record.

 

Also, what's your use case of reading records from Task table instead of inherited tables e.g incident, problem, change?

 

Regards,

Sachin