templategroup.massadd
Описание
object templategroup.massadd(параметры объекта)
Этот метод позволяет одновременно добавить несколько связанных объектов во все указанные группы шаблонов.
Этот метод доступен только пользователям с типом доступа Администратор и Супер-администратор. Разрешения на вызов метода можно отозвать в настройках ролей пользователя. Дополнительную информацию см. в разделе Роли пользователей.
Parameters
(object) Parameters containing the IDs of the template groups to update
and the objects to add to all the template groups.
The method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| groups (required) |
object/array | Template groups to be updated. The template groups must have the groupid property defined. |
| templates | object/array | Templates to add to all template groups. The templates must have the templateid property defined. |
Return values
(object) Returns an object containing the IDs of the updated template
groups under the groupids property.
Примеры
Adding templates to template groups
Add two templates to template groups with IDs 12 and 13.
Request:
{
"jsonrpc": "2.0",
"method": "templategroup.massadd",
"params": {
"groups": [
{
"groupid": "12"
},
{
"groupid": "13"
}
],
"templates": [
{
"templateid": "10486"
},
{
"templateid": "10487"
}
]
},
"auth": "f223adf833b2bf2ff38574a67bba6372",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"groupids": [
"12",
"13"
]
},
"id": 1
}
See also
Источник
CTemplateGroup::massAdd() в ui/include/classes/api/services/CTemplateGroup.php.