object template.create(object/array templates)
This method allows to create new templates.
(object/array) Templates to create.
Additionally to the standard template properties, the method accepts the following parameters.
|object/array||Host groups to add the template to.
The host groups must have the
|templates||object/array||Templates to be linked to the template.
The templates must have the
|macros||object/array||User macros to be created for the template.|
|hosts||object/array||Hosts to link the template to.
The hosts must have the
(object) Returns an object containing the IDs of the created templates under the
templateids property. The order of the returned IDs matches the order of the passed templates.
Create a template and link it to two hosts.
CTemplate::create() in frontends/php/include/classes/api/services/CTemplate.php.