We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

API Rest does not return network devices and only servers

KenY
Giga Contributor

I have an API REST url

 

$apiEndpoint = "https://<instancename>/api/now/table/cmdb_ci_hardware?sysparm_query=nameLIKEDEVICENAME&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_suppress_pagination_header=true&sysparm_limit=1"
 
Testing from REST API Explorer, I get values for both. Unfortunately, when I changed the device name to a server name, I get results from PowerShell. But when I use a network device, nothing returns. I checked and confirmed both server and network device are visible in CMDB. The script I used directly came from REST API Explorer.
 
api.png
 
I'm new to this, if someone can enlighten me? Thanks!
0 REPLIES 0