C++ / Zoom API / Unassign a role
Back to Collection Items
#include <CkHttp.h>
#include <CkHttpResponse.h>
void ChilkatSample(void)
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http;
bool success;
// Adds the "Authorization: Bearer <access_token>" header.
http.put_AuthToken("<access_token>");
CkHttpResponse *resp = http.QuickRequest("DELETE","https://api.zoom.us/v2/roles/:roleId/members/:memberId");
if (http.get_LastMethodSuccess() == false) {
std::cout << http.lastErrorText() << "\r\n";
return;
}
int respStatusCode = resp->get_StatusCode();
std::cout << "Response Status Code = " << respStatusCode << "\r\n";
if (respStatusCode != 204) {
std::cout << "Response Header:" << "\r\n";
std::cout << resp->header() << "\r\n";
std::cout << "Response Body:" << "\r\n";
std::cout << resp->bodyStr() << "\r\n";
std::cout << "Failed." << "\r\n";
delete resp;
return;
}
delete resp;
std::cout << "Success." << "\r\n";
}
Curl Command
curl -X DELETE
-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/roles/:roleId/members/:memberId
Postman Collection Item JSON
{
"name": "Unassign a role",
"request": {
"auth": {
"type": "oauth2"
},
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/roles/:roleId/members/:memberId",
"host": [
"{{baseUrl}}"
],
"path": [
"roles",
":roleId",
"members",
":memberId"
],
"variable": [
{
"key": "roleId",
"value": "quis officia in reprehenderit",
"description": "(Required) The role ID"
},
{
"key": "memberId",
"value": "quis officia in reprehenderit",
"description": "(Required) Member's ID"
}
]
},
"description": "User [roles](https://support.zoom.us/hc/en-us/articles/115001078646-Role-Based-Access-Control) can have a set of permissions that allows access only to the pages a user needs to view or edit. Use this API to unassign a user's role.\n\n**Scope:** `role:write:admin`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>\n**Prerequisites:**<br>\n* A Pro or a higher plan."
},
"response": [
{
"name": "**HTTP Status Code:** `204`<br>\nRole withdrawn from user.",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/roles/:roleId/members/:memberId",
"host": [
"{{baseUrl}}"
],
"path": [
"roles",
":roleId",
"members",
":memberId"
],
"variable": [
{
"key": "roleId",
"value": "quis officia in reprehenderit",
"description": "(Required) The role ID"
},
{
"key": "memberId",
"value": "quis officia in reprehenderit",
"description": "(Required) Member's ID"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "**HTTP Status Code:** `404`<br>Role or Member not found",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/roles/:roleId/members/:memberId",
"host": [
"{{baseUrl}}"
],
"path": [
"roles",
":roleId",
"members",
":memberId"
],
"variable": [
{
"key": "roleId",
"value": "quis officia in reprehenderit",
"description": "(Required) The role ID"
},
{
"key": "memberId",
"value": "quis officia in reprehenderit",
"description": "(Required) Member's ID"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}