You are not logged in.
Pages: 1
Hi,
I'm trying to add an existing network card to an existing computer through the API with powershell
So i'm making a POST request like so :
$url = "http://$serverip/glpi/apirest.php/Computer/7370/Item_DeviceNetworkCard"
$data = @{
"items_id" = "7370"
"itemtype" = "Computer"
"devicetype"= "DeviceNetworkCard"
"devices_id" = "3"
"new_devices" = "0"
"items_devicenetworkcards_id[]" = "3"
}
$ArrayList.add($data) > $null
$Body = '{ "input": ' + ($ArrayList | ConvertTo-Json )+ '}'
Invoke-RestMethod -Uri $url -Method POST -Headers $headers -Body $Body
I get the following error message regarding permissions...
Invoke-RestMethod : ["ERROR_GLPI_ADD","Vous n'avez pas les droits requis pour réaliser cette action."]
I can't find much information about it and can't figure out if my data structure is wrong or the url.
Thanks for future help ! (hopefully
Offline
Pages: 1