Chilkat Online Tools

DataFlex / Zoom API / Delete a user

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vResp
    Handle hoResp
    Integer iRespStatusCode
    String sTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"

    Get ComQuickRequest Of hoHttp "DELETE" "reprehenderit&transfer_meeting=true&transfer_webinar=true&transfer_recording=true" To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode <> 204) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Response Body:"
        Get ComBodyStr Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp
    Showln "Success."


End_Procedure

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": ""
    }
  ]
}