Skip to main content
17-Peridot
May 11, 2022
Solved

how to attach usergroup to one organisation using API

  • May 11, 2022
  • 2 replies
  • 1407 views

Iam creating users, usergroups, organisation in runtime. But how to attach usergroup to one organisation using API or service ? 

AP_9587236_0-1652266141333.png

 

Best answer by DmitryTsarev

@AP_9587236  You can use REST API to trigger the service externally or use ThingWorx UI and add a helper service to a thing.

And you need the 'AddMember' service.

 

I've shot a quick sample video showcasing these two approaches.

I only noticed that the question was about adding groups, not users, after I've filmed the video, but that would be pretty much the same, besides changinf the "type" param value to "Group"

 

https://www.youtube.com/watch?v=oh0lfq0TYSE

2 replies

Support
May 11, 2022

Hi @AP_9587236 

 

If you tack this to the end of your ThingWorx url, you will see all the services that are exposed:  /Organizations/Everyone/ServiceDefinitions/

 

Note this is for the Everyone organization, so you may need to change it.

 

Regards.

 

--Sharon

17-Peridot
May 12, 2022

Yes, I am seeing these services. But how to call these services inside code ? This is not available in snippet also. When i tried this code, it is not working.
AddOrganizationalUnit({
parentName: "Testing Organization",
name: "TestingUnit"
});

And Iam not seeing Adding usergroup service in this list. 

AP_9587236_0-1652355938934.png

 

17-Peridot
May 13, 2022

@AP_9587236  You can use REST API to trigger the service externally or use ThingWorx UI and add a helper service to a thing.

And you need the 'AddMember' service.

 

I've shot a quick sample video showcasing these two approaches.

I only noticed that the question was about adding groups, not users, after I've filmed the video, but that would be pretty much the same, besides changinf the "type" param value to "Group"

 

https://www.youtube.com/watch?v=oh0lfq0TYSE