Using Group APIs

Brandon.zoom
Mon, 31 Jan 2022 22:25:15 +0000
API and Webhooks

Hello Zoom Developers!

Many Zoom Developers that we support utilize our UI for Group Management. I am writing this walkthrough post in hopes that it sheds some much needed light on our Groups APIs. Let’s hop right in!

Getting Started
For this walkthrough, you’ll need a Pro or higher account and access to a JWT/OAuth Token to make the relevant api calls (I will be using JWT exclusively).

Creating a group:

Let’s create a group named ‘TEST GROUP’. Using an authorization token, make a POST request to https://api.zoom.us/v2/groups:

import requests
import json

url = “https://api.zoom.us/v2/groups”

payload = json.dumps({
“name”: “TEST GROUP”
})
headers = {
‘Content-Type’: ‘application/json’,
‘Authorization’: ‘Bearer {{JWT TOKEN}}’
}

response = requests.request(“POST”, url, headers=headers, data=payload)

print(response.text)

Your response should look something like this:

You should also now be able to see that the group exists via the List Groups api call[a], or in the UI under Admin > User Management > Group Management[b].

a.

b.

Add Group Members

Now that we have a group, let’s add a member to it! We’ll want to make a POST request to https://api.zoom.us/v2/groups/groupID/members , where groupID is the id of TEST GROUP we received from our create/list groups response. It should look like the below:

url = “https://api.zoom.us/v2/groups/KLIRCCTqRGa0tC7pENFruw/members”

payload = json.dumps({
“members”: [
{
“email”: “brandon.herlong+group_2_user@gmail.com”
}
]
})
headers = {
‘Content-Type’: ‘application/json’,
‘Authorization’: ‘Bearer {{JWT TOKEN}}’
}

response = requests.request(“POST”, url, headers=headers, data=payload)

A successful 201 response should provide the user’s id as well as the time the user was added to the group. Now, upon calling list groups members, we can see that our user has made it to his group!

A couple of things to note here – the user’s type is 1, which points to this user being basic/unlicensed. Also, this is the user’s primary group. Similar to when using the UI, the first group you add a member to via API will default as the user’s primary group. If you want to add a user to a second or third group, and change the user’s primary, you will need to do so via the Update a group member api.

Now that we’ve gone through the basics of using the Group API, let’s look into a common use case.

Suppose you are an education organization and have teacher, student, and administrator groups. You want your teachers to join meetings with cameras on and unmuted, but leave this optional for students. Or, perhaps you only want teachers to be able to annotate during a meeting. Rather than manage these settings individually for users/per meeting, you now have the option to do this per group, via the Update locked settings endpoint. It’s important to note how to manage conflicts in the event users are in multiple groups.

And that’s group apis in a nutshell! Please feel free to comment any questions you may have, or share any use cases that you’ve come up with to display for other developers!

2 posts - 2 participants