Create an REST API for the alm_hardware (Hardware) table?

Shradha Dhakad
Tera Contributor

I am trying to build the ServiceNow API for the first time and I have an quick requirement to achieve so please can you throw some light to it?

1. Need to create an API for the alm_hardware table where need to fetch the records those who are assigned to the users and for that user we need to fetch the employee number and email from the sys_user table.

2. For the particular record in the alm_hardware table we need to check the list of incidents opened with the number so we need to create an API for the same.

@Ankur Bawiskar @Mohith Devatte @Aman Kumar Please can you help me over the same topics.

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use OOB Table API on alm_hardware

What did you start with?

Regards
Ankur

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

I was working on the Scripted REST API to fetch the details from the sys_user table.

Hi,

Scripted REST API not required for point 1

Table API will look like this

Endpoint: 

https://instanceName.service-now.com/api/now/table/alm_hardware?sysparm_query=assigned_to.name%3DDavid%20Loo&sysparm_display_value=true&sysparm_fields=assigned_to.email%2Cassigned_to.employee_number

HTTP: GET

find_real_file.png

Output:

find_real_file.png

2nd Point: Something similar on incident

Table API on incident and use query for Configuration Item.Name=<Ci Name>

Regards
Ankur

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

Hello,

Can you please help with requirement 2 if possible?