You are not logged in.
Pages: 1
Hello. I'm creating a new devices using api, how do I define template id in json?
curl 'https://glpi-dev.example.com/apirest.php/pdu' \
--header 'Content-Type: application/json' \
--header 'App-Token: WyqiqNqoEogZ0HjQpbk656cvtC8IoVPZX9JxBhlh' \
--header 'Session-Token: rl3r5nuj1viu3ouv87legpinp4' \
--data '{"input": {"name": "A040-A", "templates_id": 2}}'
Offline
I don't think this is possible. Templates are handled at the web UI display level, so the API doesn't use any of that logic.
Instead, fetch the PDU item that represents the template and copy that data into the request to create a new PDU.
Assuming PDU 2 is the template:
GET https://glpi-dev.example.com/apirest.php/PDU/2
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