Methods > glpi.updateObjects

Version Comments
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

Update existing objects.

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

Same syntax for fields as glpi.createObjects field option
You simply add the Index NAME and VALUE for each object in each itemtype you want to update.

['fields'] = array(
   'Computer'=>array(   
                        array('id'=>30,
                              'serial'=>'J87G-FDZF-970',
                              'comment'=>'Commentaire 1',
                              'otherserial'=>'000094'),

                        array('id'=>31,
                              'serial'=>'5454542-029475',
                              'comment'=>'Commentaire 2',
                              'otherserial'=>'000096')
                  ),
   'Monitor'=>array(   
                        array('id'=>7,
                              'serial'=>'12133432RE2R2'),
                        array('id'=>8,
                              'serial'=>'4234-43-EFZ-434')
                  )
);
This example :
  • Update serial, otherserial, and comment for computers that have ID = 30 and ID = 31.
  • Update serial for monitors that have ID = 7 and ID = 8.