You are not logged in.
Pages: 1
Hello,
I am trying to perform a search of computer's IP using the computer's name.
But, even if I found some search ids using the GLPI API documentation, I am not able to retrieve this data. It seems that these ids are only available for performing a search, as filters.
What I found using the List Search Option (apirest.php/listSearchOptions/:itemtype):
"126": {
"name": "IP",
"table": "glpi_ipaddresses",
"field": "name",
"datatype": "",
"nosearch": false,
"nodisplay": false,
"available_searchtypes": [
"contains",
"equals",
"notequals"
],
"uid": "Computer.IPAddress.name"
Is there a way to retrieve this data maybe using the uid? Or parsing the json file?
Thank you for your help.
David
Offline
Hey David,
What you basically wanna do is retrieve the computer's ID right?
Try to add this to your header: forcedisplay[0] with the value 126 (the data ID)
http://XXX/glpi/apirest.php/search/Computer?criteria[0][field]=1&criteria[0][searchtype]=equals&criteria[0][value]=COMPUTERNAME&forcedisplay[0]=126
Offline
Pages: 1