Chilkat Online Tools

delphiDll / Zoom API / Create users

Back to Collection Items

var
http: HCkHttp;
success: Boolean;
req: HCkHttpRequest;
resp: HCkHttpResponse;
sbResponseBody: HCkStringBuilder;
jResp: HCkJsonObject;
respStatusCode: Integer;
id: PWideChar;
first_name: PWideChar;
last_name: PWideChar;
email: PWideChar;
v_type: PWideChar;

begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

http := CkHttp_Create();

req := CkHttpRequest_Create();
CkHttpRequest_putHttpVerb(req,'POST');
CkHttpRequest_putPath(req,'/v2/users');
CkHttpRequest_putContentType(req,'multipart/form-data');
CkHttpRequest_AddParam(req,'action','ssoCreate');

CkHttpRequest_AddParam(req,'user_info','ssoCreate{"email":"et qui reprehenderit","type":1,"first_name":"nostrud enim","last_name":"fugiat Excepteur of","password":"consectetur irure moll"}');

CkHttpRequest_AddHeader(req,'Authorization','Bearer <access_token>');

resp := CkHttp_SynchronousRequest(http,'api.zoom.us',443,True,req);
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

sbResponseBody := CkStringBuilder_Create();
CkHttpResponse_GetBodySb(resp,sbResponseBody);

jResp := CkJsonObject_Create();
CkJsonObject_LoadSb(jResp,sbResponseBody);
CkJsonObject_putEmitCompact(jResp,False);

Memo1.Lines.Add('Response Body:');
Memo1.Lines.Add(CkJsonObject__emit(jResp));

respStatusCode := CkHttpResponse_getStatusCode(resp);
Memo1.Lines.Add('Response Status Code = ' + IntToStr(respStatusCode));
if (respStatusCode >= 400) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(CkHttpResponse__header(resp));
    Memo1.Lines.Add('Failed.');
    CkHttpResponse_Dispose(resp);
    Exit;
  end;
CkHttpResponse_Dispose(resp);

// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)

// {
//   "id": "string",
//   "first_name": "string",
//   "last_name": "string",
//   "email": "string",
//   "type": "integer"
// }

// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

id := CkJsonObject__stringOf(jResp,'id');
first_name := CkJsonObject__stringOf(jResp,'first_name');
last_name := CkJsonObject__stringOf(jResp,'last_name');
email := CkJsonObject__stringOf(jResp,'email');
v_type := CkJsonObject__stringOf(jResp,'type');

CkHttp_Dispose(http);
CkHttpRequest_Dispose(req);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'action=ssoCreate'
	--form 'user_info=ssoCreate{"email":"et qui reprehenderit","type":1,"first_name":"nostrud enim","last_name":"fugiat Excepteur of","password":"consectetur irure moll"}'
https://api.zoom.us/v2/users

Postman Collection Item JSON

{
  "name": "Create users",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "action",
          "value": "ssoCreate",
          "description": "(Required) The action to take to create the new user: \n* `create` — The user receives an email from Zoom containing a confirmation link. The user must then use the link to activate their Zoom account. The user can then set or change their password. \n* `autoCreate` — This action is for Enterprise customers with a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain. \n* `custCreate` — Users created with this action do not have passwords and will **not** have the ability to log into the Zoom web portal or the Zoom client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must [contact the Integrated Software Vendor (ISV) sales team](https://docs.google.com/forms/d/e/1FAIpQLSe8FundLOYp8TMptSwWYeFt7QGKlp4yw4YHilta9M0ycxdoNw/viewform). \n* `ssoCreate` — This action is provided for the enabled “Pre-provisioning SSO User” option. A user created this way has no password. If it is **not** a Basic user, a personal vanity URL with the username (no domain) of the provisioning email is generated. If the username or PMI is invalid or occupied, it uses a random number or random personal vanity URL. (This can only be one of create,autoCreate,custCreate,ssoCreate)",
          "type": "text"
        },
        {
          "key": "user_info",
          "value": "{\"email\":\"et qui reprehenderit\",\"type\":1,\"first_name\":\"nostrud enim\",\"last_name\":\"fugiat Excepteur of\",\"password\":\"consectetur irure moll\"}",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/users",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users"
      ]
    },
    "description": "Use this API to add a new user to your Zoom account. \n\n**Scopes:** `user:write:admin`, `user:write` <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` \n\n **Note:** The following rate limits apply when you use the `create` value for the `action` field: \n* 50 requests per day for **Free** accounts. \n* 1,500 requests per day for **Pro** accounts. \n* 10,000 requests per day for **Business+** accounts. \n\n**Prerequisites:** \n* A Pro or higher plan."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `201`<br>\nUser created.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "ssoCreate",
              "description": "(Required) The action to take to create the new user: \n* `create` — The user receives an email from Zoom containing a confirmation link. The user must then use the link to activate their Zoom account. The user can then set or change their password. \n* `autoCreate` — This action is for Enterprise customers with a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain. \n* `custCreate` — Users created with this action do not have passwords and will **not** have the ability to log into the Zoom web portal or the Zoom client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must [contact the Integrated Software Vendor (ISV) sales team](https://docs.google.com/forms/d/e/1FAIpQLSe8FundLOYp8TMptSwWYeFt7QGKlp4yw4YHilta9M0ycxdoNw/viewform). \n* `ssoCreate` — This action is provided for the enabled “Pre-provisioning SSO User” option. A user created this way has no password. If it is **not** a Basic user, a personal vanity URL with the username (no domain) of the provisioning email is generated. If the username or PMI is invalid or occupied, it uses a random number or random personal vanity URL. (This can only be one of create,autoCreate,custCreate,ssoCreate)",
              "type": "text"
            },
            {
              "key": "user_info",
              "value": "{\"email\":\"et qui reprehenderit\",\"type\":1,\"first_name\":\"nostrud enim\",\"last_name\":\"fugiat Excepteur of\",\"password\":\"consectetur irure moll\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users"
          ]
        }
      },
      "status": "Created",
      "code": 201,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Location",
          "value": "quis officia in reprehenderit",
          "description": "Location of created User"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"id\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"email\": \"string\",\n \"type\": \"integer\"\n}"
    },
    {
      "name": "**HTTP Status Code:** `400` <br> Bad Request \n\n **Error Code:** `300` <br> Invalid parameter: password \n\n **Error Code:** `200` <br> No privilege. <br> No permission, please contact Zoom customer support. \n\n **Error Code:** `1000` <br> The user cannot be ",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "ssoCreate",
              "description": "(Required) The action to take to create the new user: \n* `create` — The user receives an email from Zoom containing a confirmation link. The user must then use the link to activate their Zoom account. The user can then set or change their password. \n* `autoCreate` — This action is for Enterprise customers with a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain. \n* `custCreate` — Users created with this action do not have passwords and will **not** have the ability to log into the Zoom web portal or the Zoom client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must [contact the Integrated Software Vendor (ISV) sales team](https://docs.google.com/forms/d/e/1FAIpQLSe8FundLOYp8TMptSwWYeFt7QGKlp4yw4YHilta9M0ycxdoNw/viewform). \n* `ssoCreate` — This action is provided for the enabled “Pre-provisioning SSO User” option. A user created this way has no password. If it is **not** a Basic user, a personal vanity URL with the username (no domain) of the provisioning email is generated. If the username or PMI is invalid or occupied, it uses a random number or random personal vanity URL. (This can only be one of create,autoCreate,custCreate,ssoCreate)",
              "type": "text"
            },
            {
              "key": "user_info",
              "value": "{\"email\":\"et qui reprehenderit\",\"type\":1,\"first_name\":\"nostrud enim\",\"last_name\":\"fugiat Excepteur of\",\"password\":\"consectetur irure moll\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404` **Not Found**<br><br>\n**Error Code:** `4130`<br>\nGroup does not exist: $groupId<br>",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "ssoCreate",
              "description": "(Required) The action to take to create the new user: \n* `create` — The user receives an email from Zoom containing a confirmation link. The user must then use the link to activate their Zoom account. The user can then set or change their password. \n* `autoCreate` — This action is for Enterprise customers with a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain. \n* `custCreate` — Users created with this action do not have passwords and will **not** have the ability to log into the Zoom web portal or the Zoom client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must [contact the Integrated Software Vendor (ISV) sales team](https://docs.google.com/forms/d/e/1FAIpQLSe8FundLOYp8TMptSwWYeFt7QGKlp4yw4YHilta9M0ycxdoNw/viewform). \n* `ssoCreate` — This action is provided for the enabled “Pre-provisioning SSO User” option. A user created this way has no password. If it is **not** a Basic user, a personal vanity URL with the username (no domain) of the provisioning email is generated. If the username or PMI is invalid or occupied, it uses a random number or random personal vanity URL. (This can only be one of create,autoCreate,custCreate,ssoCreate)",
              "type": "text"
            },
            {
              "key": "user_info",
              "value": "{\"email\":\"et qui reprehenderit\",\"type\":1,\"first_name\":\"nostrud enim\",\"last_name\":\"fugiat Excepteur of\",\"password\":\"consectetur irure moll\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users"
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `409`<br>User with that email already exists<br>\n**Error Code:** `1005`<br>Email $email has already been used.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "ssoCreate",
              "description": "(Required) The action to take to create the new user: \n* `create` — The user receives an email from Zoom containing a confirmation link. The user must then use the link to activate their Zoom account. The user can then set or change their password. \n* `autoCreate` — This action is for Enterprise customers with a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain. \n* `custCreate` — Users created with this action do not have passwords and will **not** have the ability to log into the Zoom web portal or the Zoom client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must [contact the Integrated Software Vendor (ISV) sales team](https://docs.google.com/forms/d/e/1FAIpQLSe8FundLOYp8TMptSwWYeFt7QGKlp4yw4YHilta9M0ycxdoNw/viewform). \n* `ssoCreate` — This action is provided for the enabled “Pre-provisioning SSO User” option. A user created this way has no password. If it is **not** a Basic user, a personal vanity URL with the username (no domain) of the provisioning email is generated. If the username or PMI is invalid or occupied, it uses a random number or random personal vanity URL. (This can only be one of create,autoCreate,custCreate,ssoCreate)",
              "type": "text"
            },
            {
              "key": "user_info",
              "value": "{\"email\":\"et qui reprehenderit\",\"type\":1,\"first_name\":\"nostrud enim\",\"last_name\":\"fugiat Excepteur of\",\"password\":\"consectetur irure moll\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users"
          ]
        }
      },
      "status": "Conflict",
      "code": 409,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `429` <br> You have exceeded the daily rate limit ({0}) of user invite requests permitted for this account. You may resume these requests at GMT 00:00:00.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "ssoCreate",
              "description": "(Required) The action to take to create the new user: \n* `create` — The user receives an email from Zoom containing a confirmation link. The user must then use the link to activate their Zoom account. The user can then set or change their password. \n* `autoCreate` — This action is for Enterprise customers with a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain. \n* `custCreate` — Users created with this action do not have passwords and will **not** have the ability to log into the Zoom web portal or the Zoom client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must [contact the Integrated Software Vendor (ISV) sales team](https://docs.google.com/forms/d/e/1FAIpQLSe8FundLOYp8TMptSwWYeFt7QGKlp4yw4YHilta9M0ycxdoNw/viewform). \n* `ssoCreate` — This action is provided for the enabled “Pre-provisioning SSO User” option. A user created this way has no password. If it is **not** a Basic user, a personal vanity URL with the username (no domain) of the provisioning email is generated. If the username or PMI is invalid or occupied, it uses a random number or random personal vanity URL. (This can only be one of create,autoCreate,custCreate,ssoCreate)",
              "type": "text"
            },
            {
              "key": "user_info",
              "value": "{\"email\":\"et qui reprehenderit\",\"type\":1,\"first_name\":\"nostrud enim\",\"last_name\":\"fugiat Excepteur of\",\"password\":\"consectetur irure moll\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users"
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}