REST API query for business services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2016 02:05 AM
We have 'VDI' business services and all CI's and all CI relationship related to this services.
I need to get the Correct query REST API for this service 'VDI' , so that all CIs & relationship (cmdb_ci and cmdb_rel_ci) for service will be linked to 3rd party dashboard.
How can we achieve this? can anyone please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2016 05:06 AM
If I understand you requirement correctly, you want a REST GET call to return values from multiple tables(Here, cmdb and other related tables)
Easiest way to do this would be to setup a database view. Then use this table for the REST API calls.
Database Views - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2016 07:18 AM
i have used REST GET calling for the table 'cmdb_rel_ci' and to query the Service = VDI .
The REST endpoint i gave as https://<instance_name>/api/now/table/cmdb_rel_ci_list.do?sysparm_query=GOTOparent.name%3DVDI&syspar...=
but getting error as HTTP 400 - The webpage cannot be found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 02:26 AM
You are using wrong endpoint.
The EndPoint should be like this:
https://<instance_name>/api/now/table/cmdb_rel_ci?sysparm_query=GOTOparent.name%3DVDI&sysparm_view
Do not use tableName_list.do ... You have to only use the name of the table.