Adding a single user to a single group using the API

(Paul Apostolos) #1

I need to add a single user to a group via the API.

It seems the only way to do this is to request the group members (via the api) then construct a comma delimited string of all the members (including the new member) and PUT that back to /admin/groups/ID.

Do I have that workflow correct? Or am I missing some easier way to add a user to a group?

(Adam Capriola) #2

Yep, that’s exactly how I did it.

(Paul Apostolos) #3

I saw your post @AdamCapriola…But, I was hoping there was a better way.

(Sol) #4

A simpler way via the API would be great :slight_smile: also removing would be nice

(Del Boy Trotter) #5

PUTting the whole group like that is standard REST, you’re asking for an RCP style API which I doubt the guys would be up for as it would be polluting the API

(Sol) #6

But there is still the problem that there is a hard limit of 200 with this PUT and isn’t it weird to put hundreds of users instead of adding just one? Maybe I do not get the basic idea behind that?!

(Del Boy Trotter) #7

what we are talking about here is unbounded result sets. Just the other way around. Perhaps when PUTting a large set we need to specify pagination so we can append it?

Just googled this and found: rest - Is it OK to partially change a collection with PUT or DELETE? - Software Engineering Stack Exchange

So you either make the value object entities, update part of the collection or create alternate non-RESTful operations

(Sol) #8

I think I have to pay a Dev to make this possible as this is beyond my coding skills at the moment :wink: I just started to learn how to make easy calls