Create a User with the Zoom API and assign the Pending User to a User Group

Description
Create a User with the Zoom API and assign the Create a User to a User Group. Is it possible to Create a User and Assign the Pending User to a group with the API endpoints?

Error
When we use the Zoom API to Create a User, then we are making a call to add the User to a User Group. When the User confirms the invite, the User is not placed into the User Group. From the Add Group Members we receive a 201 so it looks good, but does not happen or show in the GUI.

The Response we receive from Zoom is in the yellow box:


As you can see the ids is empty.

Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT

Which Endpoint/s?


How To Reproduce (If applicable)
Steps to reproduce the behavior:
Add Group Member Payload

{
   "members":[
      {
         "id":"_BB0znJMTC63_wcq5e6lDg",
         "email":null
      }
   ]
}

Hey @besteman,

Once the user confirms their email, they should show up in the group. :slight_smile:

Thanks,
Tommy

@tommy

Here is the code:

from dotenv import load_dotenv, find_dotenv
from time import time
import json
import jwt
import requests
import os

load_dotenv(find_dotenv())

def generate_token():
    token = jwt.encode(
        # Create a payload of the token containing API Key & exp time
        {"iss": os.getenv('api_key'), "exp": time() + 5000},
        # Secret used to generate token signature
        os.getenv('api_secret'),
        # Specify the hashing alg
        algorithm="HS256"
        # Converts token to utf-8
    ).decode("utf-8")

    return token

jwt_token = generate_token()

print(jwt_token)
print(time() + 5000)

headers = {
'authorization': f"Bearer {jwt_token}",
'content-type': "application/json"
}

payload = {
  'action': 'create',
  "user_info": {
    "email": "test@gmail.com",
    "type": 1,
    "first_name": "Justin",
    "last_name": "Test"
  }
}


request = requests.post("https://api.zoom.us/v2/users", headers=headers, json=payload)

print(request.status_code)

payload_group = {
  "members": [
    {
      "email": "test@gmail.com"
    }
  ]
}

request_group = requests.post('https://api.zoom.us/v2/groups/gjkclzrASraaagFr2C28Ig/members', headers=headers, json=payload_group)

print(request_group.url)

print(request_group.json())

Both post requests return a 201 showing that it was successful.

The response from the second post is this

{'ids': '', 'added_at': '2020-07-02T02:19:47Z'}

After I accept the invite, the user is not placed into the group

Hey @besteman,

Okay, I will see if this is intended functionality with the API or a bug. (ZOOM-175614)

In the meantime, you could use the User Invitation Accepted Webhook to set off a task in your backend that then calls the Add Group Member API.

Thanks,
Tommy

@tommy
Is there any update on this one?

Hey @besteman,

No update yet. It is in the queue to be fixed.

Thanks for your patience.

-Tommy

Nice to meet you. Tommy.
The same phenomenon is occurring for IMGroup, so please check it.

Hey @yse0893,

Can you please create a new topic and fill out the post template so we have enough info to help? :slight_smile:

Thanks,
Tommy

Hey @besteman,

This will be fixed in a release in October. :slight_smile:

Thanks,
Tommy

1 Like

@tommy
Awesome to hear!

@besteman — glad we could help. Stay tuned to our Changelog!

Hello,
I have the same problem.Panding user I can not assign groups and IM groups.
Panding user I can not assign groups and IM groups.

I have tested the two options:
https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groupmemberscreate
https://marketplace.zoom.us/docs/api-reference/zoom-api/im-groups/imgroupmemberscreate

As answer I get string(44) “{“ids”:”", “added_at”: “2021-01-28T07:50:04Z”}"
But the user is not in the group .

When creating a new user, it is not possible to pass groups or IM groups: https://marketplace.zoom.us/docs/api-reference/zoom-api/users/usercreate

Does anyone have an example of how I can create a user that is in an IM group and group inside?

Thanks a lot

Hey @Andreas,

Thank you for reaching out to the Zoom Developer Forum. If the user is still pending, please try using the group_id field of the Update a User API.

I hope that helps!

Thanks,
Max

It’s (Update a User API) not working as expected. We’re getting 404 error with the code 1001 for pending users.

{"code":1001,"message":"User does not exist: nDbAiPbTSuC_tjII2hUGug."}

Hi @hdogan1,

Can you confirm that the user in question has activated their Zoom account? They will remain pending until they click the link in the verification email sent to their email address.

Let me know if this might be the case—thanks!
Will