Chilkat Online Tools

unicodeC / Zoom API / Create users

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkHttpRequestW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkJsonObjectW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkHttpRequestW req;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *id;
    const wchar_t *first_name;
    const wchar_t *last_name;
    const wchar_t *email;
    const wchar_t *v_type;

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

    http = CkHttpW_Create();

    req = CkHttpRequestW_Create();
    CkHttpRequestW_putHttpVerb(req,L"POST");
    CkHttpRequestW_putPath(req,L"/v2/users");
    CkHttpRequestW_putContentType(req,L"multipart/form-data");
    CkHttpRequestW_AddParam(req,L"action",L"ssoCreate");

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

    CkHttpRequestW_AddHeader(req,L"Authorization",L"Bearer <access_token>");

    resp = CkHttpW_SynchronousRequest(http,L"api.zoom.us",443,TRUE,req);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkHttpRequestW_Dispose(req);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkHttpRequestW_Dispose(req);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    id = CkJsonObjectW_stringOf(jResp,L"id");
    first_name = CkJsonObjectW_stringOf(jResp,L"first_name");
    last_name = CkJsonObjectW_stringOf(jResp,L"last_name");
    email = CkJsonObjectW_stringOf(jResp,L"email");
    v_type = CkJsonObjectW_stringOf(jResp,L"type");


    CkHttpW_Dispose(http);
    CkHttpRequestW_Dispose(req);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_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": ""
    }
  ]
}