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":"",
         "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//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:."}

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

@will.zoom more than six month later and this issue still persists, expected from Zoom as usual, so frustrating.

I can not assign new users to a group.

  1. create a new user

  2. attempt to add using the addGroupMembers endpoint DOES NOT WORK

  3. attempt to add using the updateUser endpoint DOES NOT WORK

    Sending a request to https://api.zoom.us {“method”:“POST”,“resource”:"/v2/users",“options”:{“json”:{“action”:“custCreate”,“user_info”:{“email”:“redacted”,“type”:2}}}}
    redacted host created.
    Sending a request to https://api.zoom.us {“method”:“POST”,“resource”:"/groups/2Cpt2mQhQC2ByMV6bFHmGQ/members",“options”:{“json”:{“members”:{“id”:“9gQoyziBS4-2JBKUJvcC2A”}}}}
    Client error: POST https://api.zoom.us/groups/2Cpt2mQhQC2ByMV6bFHmGQ/members resulted in a 404 Not Found

do not ask me for more details. We have reported this several times, DO YOUR OWN TESTS.

I will be adding this users MANUALLY taking me hours something that should be one in seconds.

Hey @Emanuel_Aguirre,

I’m sorry to hear that you’re finding problems with the API to be so prevalent. I can assure you that’s not the developer experience we are working to provide. I’happy m to help debug any issues you’re seeing and to make sure any bugs we find are resolved in a timely manner.

I tested this out on my end by following these steps:

  1. Create a group using the Create a Group API

POST /groups

{
    "name": "Test Group"
}
  1. Create a custCreate user with the Create a User API

POST /users

{
  "action": "custCreate",
  "user_info": {
    "email": "newuser@example.fake",
    "type": 1,
    "first_name": "New",
    "last_name": "User"
  }
}
  1. Add the User to a group using the Add Group Members API

POST /groups/:groupId/members

{
    "members": [
        {
            "id": "abcdefghijklmnop1234567",
            "email": "newuser@example.fake"
        }
    ]
}

Following those steps, I then navigated to the Zoom Web Portal and saw that this user had been created as was a member of the “Test Group” group.

Are you able to provide ticket numbers or forum posts where you have reported this before? I’ll use the information there to troubleshoot the issue you’re seeing further.

Thanks,
Max

Hi all,

I thought I’d join this party, since I experience the same issues.

Thanks @MaxM for your precise scenario above. I guess this works if you have the action : custCreate. The problem however is when you want to add a (pending) user posted with the action : create param. Then, as mentioned above, the response to a post against /groups/ThKDKrkuTbem3VG-xxxx/members is

{
    "ids": "",
    "added_at": "2022-04-13T10:16:40Z"
}

which indicate that no group id has been set to the user. This is confirmed by the user lacking group belonging after verifying her account.

So the question still remains: is there a way to add a pending user to a group? (Btw, adding group_id to the post model doesn’t help.)