You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2018-02-12 14:07:30

fercho
Guest
Registered: 2018-02-12
Posts: 4

Add component to existin computer cURL

I have bein trying to add a component to an existing Computer via cURL, I was wondering if this is viable and how could thisbe done?

Offline

#2 2018-02-12 14:38:12

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 4,084

Re: Add component to existin computer cURL

Use  glpi api.
Toi scan add  items to computer.

Check forun api section.


Trouver la panne avant de réparer...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.2.4(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.3  en test (ubuntu 16.04 mariadb 10.2.4) (attente 9.3.1 et plugin compatible avant mise en prod)

Offline

#3 2018-02-12 15:01:32

fercho
Guest
Registered: 2018-02-12
Posts: 4

Re: Add component to existin computer cURL

Im currently using the restFull api in a server, I am creating the computer using cURL and works fine, but I need to be able to add or link the components to this existing computer using cURL call. Is this possible to do it without the use of a plugin?
PD: Checked the API forum and theres nothing i could relate to this issue.

Offline

#4 2018-02-12 17:34:25

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 4,084

Re: Add component to existin computer cURL

try this url :

$url=$api_url . "/Computer/" . $computer_id . "/Computer_Item";

post the array :

[items_id] => $item_id
[computers_id] =>  $computer_id
[itemtype] => Printer


Trouver la panne avant de réparer...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.2.4(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.3  en test (ubuntu 16.04 mariadb 10.2.4) (attente 9.3.1 et plugin compatible avant mise en prod)

Offline

Board footer

Powered by FluxBB