Use the setGroupMembers
command in the groups
namespace to replace the players in an existing group with a new set.
Endpoint
POST
1 |
/groups/{groupId}/groups/setGroupMembers |
Request Parameters
This command requires a groupId
to determine the target of the command. See the Control documentation for details.
See the table below for descriptions of parameters in the body.
Parameter | Type | Value |
---|---|---|
playerIds |
array | An array of player ID strings corresponding to the new set of players for the group. |
Response
Returns a groupInfo
object, which currently only includes a group
object. The groupInfo
object may include additional information in the future.
In the event of a failure, returns a globalError
.
Example
Request
In the example below, the original group is PID0, PID1, and PID2.
1 2 3 4 5 |
{ "playerIds" : [ "PID2", "PID3" ] } |
Response
1 2 3 4 5 6 7 8 |
{ "group": { "playerIds": ["PID2","PID3"], "coordinatorId": "PID2", "id": "XYZ-123abc456:12", "name": "player2 + 1" } } |