Chilkat Online Tools

Swift / Zoom API / Delete a user

Back to Collection Items

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

    let http = CkoHttp()
    var success: Bool

    // Adds the "Authorization: Bearer <access_token>" header.
    http.AuthToken = "<access_token>"

    var resp: CkoHttpResponse? = http.QuickRequest("DELETE", url: "reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true")
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        return
    }

    var respStatusCode: Int = resp!.StatusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode != 204 {
        print("Response Header:")
        print("\(resp!.Header)")
        print("Response Body:")
        print("\(resp!.BodyStr)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil
    print("Success.")

}

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true

Postman Collection Item JSON

{
  "name": "Delete a user",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users",
        ":userId"
      ],
      "query": [
        {
          "key": "action",
          "value": "disassociate",
          "description": "Delete action options:<br>`disassociate` - Disassociate a user.<br>`delete`-  Permanently delete a user.<br>Note: To delete pending user in the account, use `disassociate`"
        },
        {
          "key": "transfer_email",
          "value": "quis officia in reprehenderit",
          "description": "Transfer email. This field is **required** if the user has upcoming Zoom Events scheduled. After you delete or disassociate the user, the user's upcoming Zoom Events will be transferred to the target user."
        },
        {
          "key": "transfer_meeting",
          "value": "true",
          "description": "Transfer meeting."
        },
        {
          "key": "transfer_webinar",
          "value": "true",
          "description": "Transfer webinar."
        },
        {
          "key": "transfer_recording",
          "value": "true",
          "description": "Transfer recording."
        }
      ],
      "variable": [
        {
          "key": "userId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
        }
      ]
    },
    "description": "Use this API to disassociate (unlink) a user or permanently delete a user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.\n\n**Deleting** a user **permanently** removes the user and their data from Zoom. Users can create a new Zoom account using the same email address. An account owner or an account admin can transfer meetings, webinars and cloud recordings to another Zoom user account before deleting.\n\n**Disassociating** a user unlinks the user from the associated Zoom account and provides the user their own basic free Zoom account. The disassociated user can then purchase their own Zoom licenses. An account owner or account admin can transfer the user's meetings, webinars, and cloud recordings to another user before disassociation.\n\n**Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `204`<br>\nUser deleted.",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId"
          ],
          "query": [
            {
              "key": "action",
              "value": "disassociate"
            },
            {
              "key": "transfer_email",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "transfer_meeting",
              "value": "true"
            },
            {
              "key": "transfer_webinar",
              "value": "true"
            },
            {
              "key": "transfer_recording",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request** <br><br> **Error Code:** `300`<br>The transfer-to email address cannot be the same as the unlinked or deleted user’s email address.<br> Unable to unlink API user(s).<br> This user has published events on Zoom Ev",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId"
          ],
          "query": [
            {
              "key": "action",
              "value": "disassociate"
            },
            {
              "key": "transfer_email",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "transfer_meeting",
              "value": "true"
            },
            {
              "key": "transfer_webinar",
              "value": "true"
            },
            {
              "key": "transfer_recording",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            }
          ]
        }
      },
      "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:** `1001`<br>\nUser does not exist: $userId.<br>",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId?action=disassociate&transfer_email=quis officia in reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId"
          ],
          "query": [
            {
              "key": "action",
              "value": "disassociate"
            },
            {
              "key": "transfer_email",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "transfer_meeting",
              "value": "true"
            },
            {
              "key": "transfer_webinar",
              "value": "true"
            },
            {
              "key": "transfer_recording",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}