How to get a user's role?


#1

Hi,

When getting a user’s information(using the “me” endpoint), it looks like user’s role is not returned? Specifically, we want to know whether a user is in admin role or not. How to do that?

Thanks in advance and regards

Navin


#2

Hi @navinmishra,

You can use the roles API.

  1. https://api.zoom.us/v2/roles - To find the type of role
  2. https://api.zoom.us/v2/roles/{role_id}/members - To see if the user is an admin for the role.

Let us know if you have any other questions.

Thanks


#3

Thanks for your reply, @Michael_Purnell . What I discovered it that when I use my admin account access token to fetch the members for a role, I get the following error -

{
“code”: 124,
“message”: “Invalid access token, does not contain scopes: [role:write:admin, role:read:admin]”
}

However, when configuring scopes for my app, I don’t see the “role” scopes listed there.
What am I missing ?

FWIW, I can use the API successfully when I use the api key and api secret using the jwt. But I need to be able to access the api using the access token.

Could you help please ?

Thanks much,
Rajeev.


#4

Hi @rajeev.pitre,

To get admin scopes, your app needs to be an account-level app.

Thanks


#5

Hi @Michael_Purnell,

I believe the app is account level -

Thanks,
Rajeev.


#6

Hi @Michael_Purnell,

Also I do see the roles once I use the api key and secret -

Thanks,
Rajeev.


#7

Hi @Michael_Purnell,

I also happen to have admin privileges -

Still, an access token obtained with my privileges doesn’t seem to have access to the “roles” api. Also, I don’t see the necessary scopes listed to be included for my app.

Is there anything else that I’m missing ?

Thanks,
Rajeev.


#8

Rather than getting the user’s role, (or as the API calls it: “getting the members of a role”), I would think you care more about the permissions that a user has. Specifically, if you want people who can perform specific actions, then you can retrieve the permissions directly via: https://marketplace.zoom.us/docs/api-reference/zoom-api/users/userpermission