Endpoint:
POST /chat/channels/{channelId}/members
Error:
Code: 4711,
message: ‘Invalid access token, does not contain scopes:[team_chat:write:members].’
Description
I am trying (for the first time) to create a Zoom integration. The App is a general App, and its purpose is to post “announcements” to all users in an organization by authenticating as an admin, then creating a “announcements” channel if it does not exist, then looping through all users and adding them to the channel if they are not added, and then finally mentioning @all in the channel with the announcement.
According to the error message, I obviously don’t have the correct scopes, however I can not seem to find the team_chat:write:members scope in the App settings page.
I do have the team_chat:write:members:Admin scope enable however!
Here are the scopes I currently have added:
Team Chat
Enable Chatbot within Zoom Team Chat Channel
app:channel_content:write:admin
Enable Chatbot within Zoom Team Chat Channel
View all users' team chat channels
team_chat:read:channel:admin
View a chat channel
team_chat:read:user_channel:admin
View a user's chat channel
team_chat:read:list_members:admin
View a chat channel's members
team_chat:read:list_channels:admin
View chat channels
team_chat:read:list_administrators:admin
View a chat channel's admins
team_chat:read:list_user_channels:admin
View a user's chat channels
View and manage all users' team chat channels
team_chat:write:groups:admin
Add groups to a chat channel
team_chat:write:members:admin
Add members to a chat channel
team_chat:write:user_channel:admin
Create a chat channel for a user
team_chat:write:administrator:admin
Add administrators to a chat channel
team_chat:write:search_channels:admin
Search account's channels
team_chat:update:user_channel:admin
Update a user's chat channel
team_chat:read:list_groups:admin
View a chat channel's member groups
View and manage all users' team chat messages
team_chat:write:user_message:admin
Create a chat message for a user
User
View all user information
user:read:list_users:admin
View users
user:read:user:admin
View a user
Hi @halleyscomet
Thanks for reaching out to us
I believe the endpoint you are trying to call is intended to be used only for User-Level apps, but allow me some time to troubleshoot this on my end.
Is this workflow correct?
Create a channel (if the channel announcements doesn’t exist under the admin account)
Yes, you are correct.
Currently I am using the chat/channels/{channelID}/members endpiont, and get this error:
message: 'Invalid access token, does not contain scopes:[team_chat:write:members].'
Is ther eanother endpoint I should be using?
The app information in the marketplace gui is here:
Status: Draft
Date Updated: Nov 22 02:24 PM
General App
Account Level
Team Chat
It is a administrator managed app.
The scopes that I am being told to add in the error message however do not appear in the add scopes search. I have a screenshot, but can not embed the image in posts it seems.
Thank you for your reply.
What would be the design pattern for creating a channel and adding users to it be from an admin app? Adding users to channels seems like an admin-y thing to do…
Elisa, thank you for helping me out.
The create a channel endpoint does indeed work correctly.
There are a few snags that I would like to ask you about however.
The create a channel endpoint has a max 20 user add limit. My app is more geared towards enterprise orgs, where there may be 100s or 1000s of users. If I could use the above add users endpoint, this wouldn’t be a problem. Should my App be a user app instead of a admin level app after all?
Additionally, as employees join / leave a company, I would the ability to add them to the channel programmatically. Using the create channel endpoint, that would imply I would have to re-make the channel instead of just adding / deleting users from the channel. Do you have any advice for that?
Hello Elisa,
If you (or anyone else) has advice about the best way to
Create a Channel if it does not exist
Add all users of an organization to that channel
@all the channel
or like above
Create a channel with all users of an org in it
@all the channel
it would be much appreciated. From where I am now, it seems like making my App an admin level app was a mistake, because I can not add users to the chat, and can only create a chat with 20 users in it max.