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