Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document /groups/:group_id/members endpoint #9

Open
not-so-smart opened this issue Sep 1, 2021 · 3 comments
Open

Document /groups/:group_id/members endpoint #9

not-so-smart opened this issue Sep 1, 2021 · 3 comments

Comments

@not-so-smart
Copy link
Member

There's an endpoint for getting members which isn't covered in the official docs.

This endpoint can be used for fetching active or former members.

There's a required filter parameter used to specify what type of members to fetch.

More details in the comments as they become available.

@not-so-smart
Copy link
Member Author

not-so-smart commented Sep 12, 2021

GET /v3/groups/27317261/members?filter=active (fetches current members)
GET /v3/groups/27317261/members?filter=inactive (fetches former members)

the filter parameter is required, and I haven't been able to find any valid values for it besides active and inactive

the response includes an array of members similar to Group.members from the /groups endpoint, except that each member has a state property describing the status of their membership

when filter=active, each member's state is always active
when filter=inactive, each member's state is either exited, removed, or exited_removed

here's an example response where filter=inactive:

"memberships": [
  {
    "id": "645845814",          // member.ID
    "user_id": "442913",        // user.ID
    "name": "Bryan Warman",     // user.name
    "nickname": "Bryan Warman", // member.nickname
    "image_url": "https://i.groupme.com/1024x1024.jpeg.6c163c9f58614f9686d0bdbf33846469", // user.avatar? (optional)
    "autokicked": true,         // member.autokicked? (optional)
    "muted": true,              // member.muted? (optional) 
    "roles": [                  // member.roles
      "user" // (For former users, this is always "user")
    ],
    "state": "exited" // (For current users, this is always "active")
  },
  // ... more members ...
]

@not-so-smart
Copy link
Member Author

note: if a current member has the muted and/or autokicked properties set, they will be carried over when the user leaves or is removed.

@not-so-smart
Copy link
Member Author

for some reason, there's some level of permission required for using the /members endpoint

In a closed group, you can't call /members at all without admin (neither active nor inactive can be fetched this way) but you can still get a list of active members from the /groups endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant