How to create service account to call API.

niveditakumari
Mega Sage

Hi, 

 

How to create service account to call API. I need to create service account to call API an read all records from catalog item. 

There is catalog item called 'ABC' and I need to read all records from that table and that record are stored in one table. 

I need to call create service account and call API to retrieve all RITM and then we need to call API to retrieve table that stored User Registration data. 

Can you please help me with step. 

 

Regards, 

Nivedita 

 

 

 

1 ACCEPTED SOLUTION

@niveditakumari 

correct the scripted REST API resource needs to be given in postman

Also ensure you add prefix with the instance name etc in the URL

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

22 REPLIES 22

niveditakumari
Mega Sage

Hi @Dawn Jurek

 

I saw your post regarding service account to call API. 

Here is my use case : 

I need to create service account to call API and with that we can read all new joiner service request details, it should not read all request, it should only read new joiner request. 

Can you please help me with that step. 

 

Regards, 

Nivedita 

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@niveditakumari 

simply create sys_user record with "Web service access" true and give "snc_platform_rest_api_access" role

AnkurBawiskar_0-1745151720452.png

 

If you are planning to use RITM table API then ensure that user has READ Access on that table

OR
if you are planning to use scripted rest api then no extra role to be given and within Scripted REST API you can use GlideRecord and give the API response as per what customer wants

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar

 

User need to accee API and to read service request data that is created for user registration catalog item. 

User will be using Postman or UIPath to hit API and in Postman or UIPath we need to only add filter to get sc_req_item request that are in open, work in progress, or in pending state and when it enter to our system then we need to add some configuration in our system then user can read records that are for user registration service request. 

We can expose our catalog item name or sys_id to user in Postman, they might change something because of that we need to call table API sc_req_item and add filter and in system we need to add filter for catalog item data. 

When user call API then user will be able to read user registration catalog item data. 

Do we have anything to configure filter catalog item in our system. 

Can you please help me with that. 

 

Regards, 

Nivedita 

 

 

@niveditakumari 

I will suggest not to expose TABLE API of sc_req_item as it might contain sensitive data

Rather use Scripted REST API and handle the API response and only send whatever is asked

If you are still planning to use table API then ensure that API user has read access on RITM table and the variable ownership table where the data for variables is stored

sc_item_option_mtom" , "sc_item_option" , "item_option_new"

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader