Methods > glpi.getItemContracts

This method is only accessible by authenticated users

Retrieve contracts associated with a computer

input a hastable

  • help option to get usage information
  • itemtype : type of the object
  • id : ID of the object
  • id2name : option to enable id to name translation of dropdown fields
return a hashtable
  • fields of glpi_contracts

Call example

php testxmlrpc.php --url=glpi078/plugins/webservices/xmlrpc.php --method=glpi.getItemContracts --host=localhost --session=19fd3d05b1ebae82b286a712180c56b0 --help
+ Response: Array
(
    [itemtype] => string, mandatory
    [id] => integer, mandatory
    [id2name] => bool,optional
    [help] => bool,optional
)

$ php testsoap.php -url=glpi084/plugins/webservices/xmlrpc.php --method=glpi.getItemContracts --host=localhost --session=19fd3d05b1ebae82b286a712180c56b0 --id=2219 --itemtype=Computer --id2name                                                               
+ Calling 'glpi.getItemContracts' on http://localhost/0.84/plugins/webservices/xmlrpc.php                                                               
Array
(
    [2] => Array
        (
            [id] => 2
            [name] => contrat-1
            [num] => 123456
            [cost] => 1250.0000
            [contractstypes_id] => 8
            [begin_date] =>
            [duration] => 0
            [notice] => 0
            [periodicity] => 0
            [billing] => 0
            [comment] => Commentaires
            [accounting_number] =>
            [week_begin_hour] => 00:00:00
            [week_end_hour] => 00:00:00
            [saturday_begin_hour] => 00:00:00
            [saturday_end_hour] => 00:00:00
            [monday_begin_hour] => 00:00:00
            [monday_end_hour] => 00:00:00
            [use_monday] => 0
            [use_saturday] => 0
            [max_links_allowed] => 0
            [alert] => 0
            [renewal] => 0
        )

)