Create an REST API for the alm_hardware (Hardware) table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 04:44 AM
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.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 04:51 AM
Hi,
you can use OOB Table API on alm_hardware
What did you start with?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 04:54 AM
I was working on the Scripted REST API to fetch the details from the sys_user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 04:59 AM
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
Output:
2nd Point: Something similar on incident
Table API on incident and use query for Configuration Item.Name=<Ci Name>
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 05:14 AM
Hello,
Can you please help with requirement 2 if possible?