unicodeC / Zoom API / Get sharing/recording details
Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkJsonObjectW queryParams;
HCkHttpResponseW resp;
HCkStringBuilderW sbResponseBody;
HCkJsonObjectW jResp;
int respStatusCode;
const wchar_t *id;
const wchar_t *user_id;
const wchar_t *user_name;
int j;
int count_j;
const wchar_t *content;
const wchar_t *start_time;
const wchar_t *end_time;
const wchar_t *page_count;
const wchar_t *page_size;
const wchar_t *total_records;
const wchar_t *next_page_token;
int i;
int count_i;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
queryParams = CkJsonObjectW_Create();
CkJsonObjectW_UpdateString(queryParams,L"type",L"live");
CkJsonObjectW_UpdateInt(queryParams,L"page_size",30);
CkJsonObjectW_UpdateString(queryParams,L"next_page_token",L"quis officia in reprehenderit");
// Adds the "Authorization: Bearer <access_token>" header.
CkHttpW_putAuthToken(http,L"<access_token>");
resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://api.zoom.us/v2/metrics/meetings/:meetingId/participants/sharing",queryParams);
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(queryParams);
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);
CkJsonObjectW_Dispose(queryParams);
CkStringBuilderW_Dispose(sbResponseBody);
CkJsonObjectW_Dispose(jResp);
return;
}
CkHttpResponseW_Dispose(resp);
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "page_count": "integer",
// "page_size": "integer",
// "total_records": "integer",
// "next_page_token": "string",
// "participants": [
// {
// "id": "string",
// "user_id": "string",
// "user_name": "string",
// "details": [
// {
// "content": "string",
// "start_time": "string",
// "end_time": "string"
// }
// ]
// }
// ]
// }
// 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.
page_count = CkJsonObjectW_stringOf(jResp,L"page_count");
page_size = CkJsonObjectW_stringOf(jResp,L"page_size");
total_records = CkJsonObjectW_stringOf(jResp,L"total_records");
next_page_token = CkJsonObjectW_stringOf(jResp,L"next_page_token");
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"participants");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
id = CkJsonObjectW_stringOf(jResp,L"participants[i].id");
user_id = CkJsonObjectW_stringOf(jResp,L"participants[i].user_id");
user_name = CkJsonObjectW_stringOf(jResp,L"participants[i].user_name");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"participants[i].details");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
content = CkJsonObjectW_stringOf(jResp,L"participants[i].details[j].content");
start_time = CkJsonObjectW_stringOf(jResp,L"participants[i].details[j].start_time");
end_time = CkJsonObjectW_stringOf(jResp,L"participants[i].details[j].end_time");
j = j + 1;
}
i = i + 1;
}
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(queryParams);
CkStringBuilderW_Dispose(sbResponseBody);
CkJsonObjectW_Dispose(jResp);
}
Curl Command
curl -G -d "type=live"
-d "page_size=30"
-d "next_page_token=quis%20officia%20in%20reprehenderit"
-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/meetings/:meetingId/participants/sharing
Postman Collection Item JSON
{
"name": "Get sharing/recording details",
"request": {
"auth": {
"type": "oauth2"
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/sharing?type=live&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"meetings",
":meetingId",
"participants",
"sharing"
],
"query": [
{
"key": "type",
"value": "live",
"description": "The type of meeting to query: \n* `past` — All past meetings. \n* `live` - All live meetings. \n\nThis value defaults to `live`."
},
{
"key": "page_size",
"value": "30",
"description": "The number of records returned within a single API call."
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit",
"description": "The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceed the current page size. The expiration period for this token is 15 minutes."
}
],
"variable": [
{
"key": "meetingId",
"value": "quis officia in reprehenderit",
"description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
}
]
},
"description": "Retrieve the sharing and recording details of participants from live or past meetings.<br>\n**Scopes:** `dashboard_meetings:read:admin`<br>\n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n**Prerequisites:** <br>\n* Business or a higher plan."
},
"response": [
{
"name": "**HTTP Status Code:** `200`<br>\nMeeting participants returned.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/sharing?type=live&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"meetings",
":meetingId",
"participants",
"sharing"
],
"query": [
{
"key": "type",
"value": "live"
},
{
"key": "page_size",
"value": "30"
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit"
}
],
"variable": [
{
"key": "meetingId",
"value": "quis officia in reprehenderit",
"description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"page_count\": \"integer\",\n \"page_size\": \"integer\",\n \"total_records\": \"integer\",\n \"next_page_token\": \"string\",\n \"participants\": [\n {\n \"id\": \"string\",\n \"user_id\": \"string\",\n \"user_name\": \"string\",\n \"details\": [\n {\n \"content\": \"string\",\n \"start_time\": \"string\",\n \"end_time\": \"string\"\n }\n ]\n }\n ]\n}"
},
{
"name": "**Error Code:** `300`<br>\nCan not access webinar info, {meetingId}.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/sharing?type=live&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"meetings",
":meetingId",
"participants",
"sharing"
],
"query": [
{
"key": "type",
"value": "live"
},
{
"key": "page_size",
"value": "30"
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit"
}
],
"variable": [
{
"key": "meetingId",
"value": "quis officia in reprehenderit",
"description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
}
]
}
},
"status": "Multiple Choices",
"code": 300,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "**HTTP Status Code:** `404`<br>\n**Error Code:** `3001`<br>\nThis meeting's detail info is not available or ID is not valid.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/sharing?type=live&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"meetings",
":meetingId",
"participants",
"sharing"
],
"query": [
{
"key": "type",
"value": "live"
},
{
"key": "page_size",
"value": "30"
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit"
}
],
"variable": [
{
"key": "meetingId",
"value": "quis officia in reprehenderit",
"description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}