Skip to main content
17-Peridot
May 3, 2022
Question

Users API

  • May 3, 2022
  • 1 reply
  • 675 views

1. What API used to add user to usergroup in thingworx?

2. And approximately how many usergroups can be added to one usergroup?

1 reply

16-Pearl
May 4, 2022

@AP_9587236 

 

You can use below code to add users to a user group or a user group to a user group,

// Adding a user (testUser) to a user group (DevGroup)
var params = {
member: "testUser" /* STRING */,
type: "User" /* STRING */
};
Groups["DevGroup"].AddMember(params);


// Adding a user group (DevGroup) to another user group (Administrators)
var params = {
member: "DevGroup" /* STRING */,
type: "Group" /* STRING */
};
Groups["Administrators"].AddMember(params);

 

I don't think there is any limit defined for number of users groups that can be added to a user group.

 

Regards,

Sachin