datainjection icon indicating copy to clipboard operation
datainjection copied to clipboard

Import data from REST API

Open maunat opened this issue 2 years ago • 9 comments

Does Data Injection provide any kind of Rest API to inject CSV files?

maunat avatar Nov 29 '23 18:11 maunat

I am in the same case, there is a testwebservice.php but no way to get it working After a few update of the file, at the end i have this + Calling 'glpi.doLogin' on http://support-test/plugins/webservices/xmlrpc.php xmlrpc error(4): Server not ready (xml-rpc)

ready2play32 avatar Dec 08 '23 13:12 ready2play32

@ready2play32 no way to have it working. I've been looking for a possible solution for a while but at the end I personally changed my mind and starting using native GLPI restAPI.

They work even with custom objects and fields.

No much support from the plugin's Dev here. I've known they want to ingest this particular plugin into the new version of GLPI but there is no roadmap.

maunat avatar Dec 08 '23 14:12 maunat

The webservices plugin hasn't been updated in a while and that is what is currently used as an API integration by this plugin. Native API is the replacement for the webservices plugin.

Maybe a new API integration can be made between this plugin and the newer REST API coming with GLPI 10.1, or something completely native to the new API. https://github.com/glpi-project/glpi/pull/12221

cconard96 avatar Dec 08 '23 14:12 cconard96

@cconard96 thank you for your clarification. I've proposed even another enhancement for this useful plugin and it is to get it integrated natively with the statecheck one to check massive input with specific rules. Indeed, I've provided already a solution that is working to me for my business. Hope it'll be accepted some day.

Thank you

maunat avatar Dec 08 '23 14:12 maunat

Maybe the last version of glpi-webservices work but i can't find anywhere because the plugin page provide a link that does no longer exist. On sourcefourge i can only find version from 2016 if someone have version glpi-webservices-2.0.0.tar.gz to share (for GLPI 10.0.10 maybe)

Thanks

ready2play32 avatar Dec 08 '23 16:12 ready2play32

Work was started to add an integration between this plugin and the new API coming with GLPI 10.1. See #374

cconard96 avatar Dec 28 '23 13:12 cconard96

A fork exist to schedule datainjection with csv and it's working fine : https://github.com/Mirkk/datainjection

ready2play32 avatar Jan 26 '24 08:01 ready2play32

@ready2play32 how did you install his version and how does it work? I already have this plugin and all my data fields mapped.

coopernicholas avatar Feb 08 '24 12:02 coopernicholas

@coopernicholas To install this plugin, you need to git clone the repository into your glpi server and copy the folder in plugins folder of GLPI Maybe after the install, to enable schedulable injection for a glpi model, you have to manually add 2 columns into your glpi database if these are not created in table glpi_plugin_datainjection_models, make sure you have these two columns :

  • csvfilename VARCHAR(255) NOT NULL DEFAULT '',
  • enable_scheduled_injection tinyint NOT NULL DEFAULT 0,

after this you have to recreate every model that you already have if this correctly work, in model creation, you gonna see enable status of schedulable injection and csv filename to make it work and in automatic action in glpi, enable datainjection task

ready2play32 avatar Feb 08 '24 16:02 ready2play32