#TipTuesday Manage group leaders and owners via the API
hannahhowle
HLV Staff
Are you currently managing your group leaders by inviting them to be a member of the group, waiting for them to accept the invitation, and then manually promoting them to be a leader? Have you ever had to submit a ticket to Support to change the owner of a group? This #TipTuesday will help you streamline the process for managing group leaders and group owners.
What you’ll need:
- The groupID of the group you’re updating. You can find this by looking at the groups URL, which will contain a number after www.communitydomain.com/group/… In this example, the Demo Group’s groupID: 4.
- The userID of the new leader or owner. You can find this by navigating to the user’s profile and adding “.json” to the end of the URL (www.communitydomain.com.profile/username.json) which will expose some data on the user. In this example, hhowle11’s userID: 19.
Now that you have this info, you can look into…
Adding a user to a group as a leader
- Navigate to your API v2 Swagger page (Dashboard > Settings > API v2).
- Navigate to the POST /groups/{id}/members API endpoint.
- Expand the endpoint and click “Try it Out”. Here, you’ll enter the groupID (4) and update the request body to include the proper user role assignment (“leader”) and userID (19). Click the blue “Execute” button.
- Now, when you navigate to the group you will see that user added as a Leader.
Want to take it a step further?
Make a user the group owner
- Navigate to your API v2 Swagger page (Dashboard > Settings > API v2).
- Navigate to the PATCH /groups/{id} API endpoint.
- Expand the endpoint and click “Try it Out”. Here, you’ll enter the groupID (4) and remove all data from the request body except “ownerUserID”, which you’ll update with the userID (19). Click the blue “Execute” button.
- ⚠️Note⚠️ Failure to remove the other details in the request body will cause you to overwrite existing group details, like the description, privacy settings, or branding.
- Now, when you navigate to the group you will see that user as the Owner.
Hope this helps with your group management efforts!
Tagged:
0
Comments
-
@hannahhowle What a great tip grateful to you for the step by step instructions, screen shots, and use case!!
@Julie Lowe Thought you might love this one too!0
Categories
- All Categories
- 23 Getting Started
- 423 Community Hub
- 343 Talk Community
- 61 Community Announcements & News
- What do you want to to do?
- Create an Account
- I'm new here
- Talk Higher Logic Vanilla
- Talk Community
- Check out the latest release
- Submit a product idea
- Get help
- View Events