You are not logged in.
Pages: 1
Hello everybody,
How can I get software assigned to a specific computer (computer ID) using API request .
TY.
Offline
myserver/glpi/apirest.php/search/Software/?is_deleted=0&as_map=0
&criteria[0][link]=AND&criteria[0][itemtype]=Computer&criteria[0][meta]=1&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=^Computer_ID$
replace Computer_ID with tour ID ( keep ^ and $ )
it should work.
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
I tested this GET request with computer id (2 for exemple) : myserver/glpi/apirest.php/search/Software/?is_deleted=0&as_map=0
&criteria[0][link]=AND&criteria[0][itemtype]=Computer&criteria[0][meta]=1&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=^2$
I tried other computer IDs, but I got this response on all requests
{
"totalcount": 0,
"count": 0,
"sort": "1",
"order": "ASC",
"content-range": "0--1/0"
}
Offline
it works on my 9.5.5 instance.
did you get your glpi session token ?
Is logged API user allowed to see these softwares ? ( entity and profile).
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
Yea I used session token of a super admin profile
and this the URL request :
xx.withx.glpi-network.cloud/apirest.php/search/Software/?is_deleted=0&as_map=0&criteria[0][link]=AND&criteria[0][itemtype]=Computer&criteria[0][meta]=1&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=^2$
Offline
did you test this url using Glpi GUI ?
replace xx.withx.glpi-network.cloud/apirest.php/search/Software/?is_deleted=0&as_map=0&criteria[0][link]=AND&criteria[0][itemtype]=Computer&criteria[0][meta]=1&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=^2$
with
xx.withx.glpi-network.cloud/front/Software/?is_deleted=0&as_map=0&criteria[0][link]=AND&criteria[0][itemtype]=Computer&criteria[0][meta]=1&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=^2$
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
Doesn't work too /
Offline
Hi,
I had the same problem
{
"totalcount": 0,
"count": 0,
"sort": "1",
"order": "ASC",
"content-range": "0--1/0"
}
and i changed the computer ID for the test ans it worked fine.
But now i've got another problem.
myserver/glpi/apirest.php/search/Software/?is_deleted=0&as_map=0
&criteria[0][link]=AND&criteria[0][itemtype]=Computer&criteria[0][meta]=1&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=^Computer_ID$
gives me the software but also give me every version of this software and not only the installed version.
Here is an example:
[3]=>
object(stdClass)#5 (7) {
["1"]=>
string(27) "Adobe Acrobat Reader DC MUI"
["23"]=>
string(26) "Adobe Systems Incorporated"
["5"]=>
array(5) {
[0]=>
string(12) "21.005.20058"
[1]=>
string(12) "21.005.20060"
[2]=>
string(12) "21.005.20048"
[3]=>
string(12) "21.001.20155"
[4]=>
string(12) "21.007.20091"
}
["4"]=>
string(7) "Windows"
["72"]=>
int(143)
["163"]=>
NULL
["2"]=>
string(2) "51"
How can I get the installed version?
Thanks
Offline
Hi,
I had the same problem
How can I get the installed version?
Thanks
Hi, i have the same problem here, did you find a solution ?
Offline
Pages: 1