templategroup.massupdate

Description

object templategroup.massupdate(object parameters)

This method allows to replace templates with the specified ones in multiple template groups.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters containing the IDs of the template groups to update and the objects that should be updated.

ParameterTypeDescription
groupsobject/arrayTemplate groups to be updated.

The template groups must have the groupid property defined.

Parameter behavior:
- required
templatesobject/arrayTemplates to replace the current template on the given template groups.
All other template, except the ones mentioned, will be excluded from template groups.

The templates must have the templateid property defined.

Parameter behavior:
- required

Return values

(object) Returns an object containing the IDs of the updated template groups under the groupids property.

Examples

Replacing templates in a template group

Replace all templates in a template group to ones mentioned templates.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "templategroup.massupdate",
  4. "params": {
  5. "groups": [
  6. {
  7. "groupid": "8"
  8. }
  9. ],
  10. "templates": [
  11. {
  12. "templateid": "40050"
  13. }
  14. ]
  15. },
  16. "id": 1
  17. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "groupids": [
  5. "8",
  6. ]
  7. },
  8. "id": 1
  9. }

See also

Source

CTemplateGroup::massUpdate() in ui/include/classes/api/services/CTemplateGroup.php.