REST API to get HR Cases

bigbacon
Giga Guru

I am trying to access case data via REST API using asp.Net.

 

I have done this successfully for incidents in the past (both get and post) but for some reason I can't see to find out which table I need in order to access case data. 

 

I am trying to get case data base on either number (HRXXXXX) or creation_date. 

 

I tried using the table "sn_hr_core_case" but that didn't work using a test URL call of

https://INSTANCE.service-now.com/api/now/table/sn_hr_core_case?number=HRC0097319


What am I missing? 

 

EDIT: I cant seem to reply so edit.
I think I am just missing some roles possibly to do this. I can query this using my profile in the REST Api Explorer but I can't get a result using the service account we use for access rest apis. What roles does a user account need to be able to get results from this?

https://INSTANCE.service-now.com/api/now/table/sn_hr_core_case?sysparm_limit=1&number=HRC0097319

Also, iss it possible to get items based on the sys_created_on date using a >= a specific date/time? It doesn't seem like it works correctly.

2 REPLIES 2

michaelward
Tera Guru

Have you looked into these things: 1) App administration on the HR modules, and therefore 2) RCA / Caller access restrictions on tables and scripts, and 3) COE Security configurations.  HRSD is by default 'secured' so that you cannot just use a REST call to get to table data.   In fact, even within the ServiceNow platform, these security restrictions even prevent internal apps from getting to data, depending on their scopes and caller access restriction settings. 

SupriyaWaghmode
Kilo Sage

Hello @bigbacon ,

 

Validate the URL also check the roles for .NET user in servicenow to read /write/create hr case.

Please steps in servicenow to validate url and fields for rest integration can use for troubleshoot 

1. Navigate rest api explore in your ServiceNow instance

2. Select table api

3.retrive a record [get]

4.add details as "sn_hr_core_case" and sys_id of record to extract which need s extract and check 200 response.

SupriyaWaghmode_1-1742217028952.png

 

Thanks & Regards ,

Supriya Waghmode |ServiceNow Consultant