Assigning Users to a Group
Users can be assigned to a group by submitting a Group event using the Group endpoint.POST /api/public/apps/group
Because groups are themselves users, its important to ensure that group ids and standard user ids don’t clash. This is a risk for teams which are using auto-incrementing integer ids.To address this, we recommend using a prefix for group ids. For example, “group-123” instead of “123”.
POST /api/public/apps/group
POST /api/public/apps/track
Unassigning Users from a Group
To unassign a user from a group, you can use theassign
flag and set it to false
.
POST /api/public/apps/group
Retrieval
You can retrieve groups for a user with the/groups/user-groups
endpoint.
You can also retrieve all users for a group with the /groups/users
endpoint.
Examples
Parents and Children
Imagine you’re running a school. Your users in Dittofeed are the parents whose contacts you’ve imported. Parents share children between them. So for example, John and Jane are both parents of Sam. You can represent this in Dittofeed by creating a group for Sam, and then adding John and Jane as members.POST /api/public/apps/group
POST /api/public/apps/group
/groups/users
endpoint.
GET /api/admin/groups/users