You are not logged in.
Pages: 1
Hello,
I am looking for a much more precise documentation about the apirest.
I managed to make what I needed through trial and error to find the names to put after [...]/apirest.php/HERE/?sessiontoken
I was looking for the list or atleast how to find the name required to work with.
Please note that I am not using Curl, i am programming a tool under python using a module that requires the URL.
(which is also the same way i am testing things out with postman)
The thing is that i am looking for a way to add a network port on computers to add the actual mac address (and probably the IP)
but I cant seem to "easily" find informations about what I am asking right now.
It asks for "itemType" but it does not specify anywhere where to find all the names to easily work with them.
The reason we are programming a tool with python is to add all our computers manually without using any type of clients while still automating the addition process with the computer informations.
Thank you very much in advance !
Offline
I managed to find it here:
apirest.php/Computer/:id/NetworkPort/
But i am still curious, is there a list somewhere of the types like :
Computer
NetworkPort
Offline
There is no good list. This API is very low level. You can guess what the valid itemtypes are based on the PHP class names. In GLPI 9.5.X and earlier, these would be the files in the inc folder. In GLPI 10, these files were mostly moved to the src folder.
For example, computer.class.php in GLPI 9.5 refers to "Computer" itemtype. Itemtypes always have the first letter capitalized and the file extensions should not be included (.class.php, .php).
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
I have tried adding a network port based from another topic on this forum and I cant figure out what's not working out:
/viewtopic.php?id=167092
Last edited by blackxthink (2022-04-27 22:00:10)
Offline
Ok... Finally managed to fix it.
The URL in postman was HTTP but shouldve been HTTPS
Offline
Pages: 1