Logotype Sitevision Developer
Log in
Log in

VirtualGroups REST API endpoint

Disclaimer: This endpoint documentation is generated from the latest Sitevision version. It might differ from the actual Sitevision environment where your website resides.

Use the RestApi utility of the Public API for server-side access of this endpoint.

Virtual Groups

Management of sv:virtualGroup instances of the site and read of shared sv:globalVirtualGroup instances applicable for the site.

Applicable to the sv:virtualGroupRepository.

GET

Returns all virtual groups or a specified virtual group.

Requirements

The feature "virtual-groups" that enables usage of Virtual groups.

Permissions

Requires that the caller is authorized to READ and MANAGE_USERS on the sv:site.

Retrieving all virtual groups

Returns an array of all sv:virtualGroup and sv:globalVirtualGroup.

Example URL

2.7f84551a13dab43a224c_virtualGroupRepository/virtualgroups

Example response

[
   {
      "id": "254.6f6df1a8185bf3514f91",
      "groupId": "grpid_4",
      "type": "sv:virtualGroup",
      "name": "Virtual group four",
      "description": "",
      "criterias": [],
      "members": []
   },
   {
      "id": "254.6f6df1a8185bf3514f92",
      "groupId": "grpid_admin",
      "type": "sv:virtualGroup",
      "name": "Admin group",
      "description": "",
      "criterias": [
         {
            "control": "sufficient",
            "type": "ATTRIBUTE",
            "attributeName": "role",
            "attributeValue": "Admin"
         },
         {
            "control": "sufficient",
            "type": "USER",
            "userId": "247.39396463326530312d326466333"
         }
      ],
      "members": [
         "255.1a68aad11851ab06d241"
      ]
   }
]

Retrieving a virtual group

Returns an object containing a specific sv:virtualGroup or sv:globalVirtualGroup

Example URL

2.7f84551a13dab43a224c_virtualGroupRepository/virtualgroups/254.6f6df1a8185bf3514f91

Example response

{
   "id": "254.6f6df1a8185bf3514f91",
   "groupId": "grpid_4",
   "type": "sv:virtualGroup",
   "name": "Virtual group four",
   "description": "",
   "criterias": [],
   "members": []
}

POST

Creates a new virtual group of type sv:virtualGroup.

Returns an object containing the newly created sv:virtualGroup.

Requirements

The feature "virtual-groups" that enables usage of Virtual groups.

Permissions

Requires that the caller is authorized to WRITE and MANAGE_USERS on the sv:site.

Parameters

Name Type Description
groupId string The group id (a.k.a simpleid) - the value that identifies the virtual group
name string The name of the virtual group
description string Optional group description
criterias array Optional array of objects that depicts one or more criterias. Each criteria can be of type ATTRIBUTE or USER, see GET example above for format.

Note! The userId of a USER type criteria must depict a sv:user (prefix 247.), a sv:userGroup (prefix 248.) or a sv:userContainer (prefix 249.) of the site.

members array Optional array of user identifier strings.

Note! Each identifier must depict a sv:user (prefix 247.) or sv:simpleUser (prefix 255.) of the site.

Example URL

2.7f84551a13dab43a224c_virtualGroupRepository/virtualgroups

Example input

{
   "groupId": "group_five",
   "name": "Virtual group five"
}

Example response

{
   "id": "254.5e913b7f185bfc03c691",
   "groupId": "group_five",
   "type": "sv:virtualGroup",
   "name": "Virtual group five",
   "description": "",
   "criterias": [],
   "members": []
}

PUT

Updates a virtual group of type sv:virtualGroup.

Returns an object containing the newly updated sv:virtualGroup.

Requirements

The feature "virtual-groups" that enables usage of Virtual groups.

Permissions

Requires that the caller is authorized to WRITE and MANAGE_USERS on the sv:site.

Note that sv:globalVirtualGroup instances are immutable. They are shared by all sites and can not be updated via this endpoint.

Parameters

Name Type Description
name string The name of the virtual group
description string Optional group description
criterias array Optional array of objects that depicts one or more criterias. Each criteria can be of type ATTRIBUTE or USER, see GET example above for format.

Note! The userId of a USER type criteria must depict a sv:user (prefix 247.), a sv:userGroup (prefix 248.) or a sv:userContainer (prefix 249.) of the site.

members array Optional array of user identifier strings.

Note! Each identifier must depict a sv:user (prefix 247.) or sv:simpleUser (prefix 255.) of the site.

Example URL

2.7f84551a13dab43a224c_virtualGroupRepository/virtualgroups/254.5e913b7f185bfc03c691

Example input

{
   "name": "Virtual group five",
   "description": "The five group"
}

Example response

{
   "id": "254.5e913b7f185bfc03c691",
   "groupId": "group_five",
   "type": "sv:virtualGroup",
   "name": "Virtual group five",
   "description": "The five group",
   "criterias": [],
   "members": []
}

DELETE

Deletes a virtual group of type sv:virtualGroup.

Returns an object containing the newly deleted sv:virtualGroup.

Requirements

The feature "virtual-groups" that enables usage of Virtual groups.

Permissions

Requires that the caller is authorized to DELETE and MANAGE_USERS on the sv:site.

Note that sv:globalVirtualGroup instances are immutable. They are shared by all sites and can not be deleted via this endpoint.

Example URL

2.7f84551a13dab43a224c_virtualGroupRepository/virtualgroups/254.5e913b7f185bfc03c691

Example response

{
   "id": "254.5e913b7f185bfc03c691",
   "groupId": "group_five",
   "type": "sv:virtualGroup",
   "name": "Virtual group five",
   "description": "The five group",
   "criterias": [],
   "members": []
}
Did you find the content on this page useful?