Methods > glpi.deleteObjects

Version Comments
1.4.3 parameters
1.3.0 no change
1.2.0 must be super admin to use this method
1.1.0 Method added

This method is only accessible by authenticated and super-admin users

Delete or purge objects.

input hastable
  • help : for showing parameters name, type, and mandatory/optional
  • fields : an array for delete/purge Object(s) in GLPI

However, the array-structure is not the same as glpi.createObjects.
For each object in each itemtype you can just put the couple Index VALUE => Delete/Purge .

  • If Delete/Purge = true : the object is Purged in GLPI.
  • If Delete/Purge = false : the object is marked as is_deleted in GLPI (and you can see him in the trash).
['fields'] = array('Computer'=>array(array('id' => 27,
                                           'force' => true),
                                     array('id' => 28,
                                           'force' => false)),
                   'Monitor'=>array(array('id' => 5,
                                          'force' =>true),
                                    array('id' => 6,
                                          'force' => true));            
This example :
  • Purge the Computer with ID = 27
  • Delete the Computer with ID = 28
  • Purge Monitors with ID = 5 and ID = 6