You are not logged in.
Pages: 1
Hello,
I imported the tickets of our old ticketsystem via API now I wonder if i can do the same thing with the Computers how would that work ?
With kind regards
SomeDude
Offline
The process is the same. You need to know the internal class name for the type of asset (Computer, Monitor, NetworkEquipment, etc) and the names of the fields the items of that type can have (you can see this by getting an existing item of that type via the API).
For example, to create a computer:
POST /apirest.php/Computer
Body:
{
"id": 60,
"entities_id": 0,
"name": "ComputerFromAPI",
"serial": "MySerialNumber"
}
Your other option is the Data Injection plugin which lets you import data with a CSV file instead.
https://plugins.glpi-project.org/#/plugin/datainjection
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Hello,
sorry for the late reply, I tried the API method and I only get the error "ERROR_BAD_ARRAY".
As a test I pulled a Computer I created and tried to post it again to add a new one after changing id, name and serialnumber.
Any ideas what im doing wrong, I am using Postman.
Offline
Found my mistake forgot to add input:
bsp.
{"input":
{
"id": 4,
"entities_id": 1,
"name": "Test API",
"groups_id_tech": 1,
"serial": 123543,
"users_id": 3215
}
}
Offline
Sorry, I forgot that was required for the current GLPI API.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Pages: 1