Chilkat Online Tools

unicodeC / Zoom API / Get meeting reports

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;

    // 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"from",L"1989-05-07");
    CkJsonObjectW_UpdateString(queryParams,L"to",L"1989-05-07");
    CkJsonObjectW_UpdateInt(queryParams,L"page_size",30);
    CkJsonObjectW_UpdateString(queryParams,L"next_page_token",L"quis officia in reprehenderit");
    CkJsonObjectW_UpdateString(queryParams,L"type",L"past");

    // 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/report/users/:userId/meetings",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);


    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(queryParams);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -G -d "from=1989-05-07"
	-d "to=1989-05-07"
	-d "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-d "type=past"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/report/users/:userId/meetings

Postman Collection Item JSON

{
  "name": "Get meeting reports",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/report/users/:userId/meetings?from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit&type=past",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "report",
        "users",
        ":userId",
        "meetings"
      ],
      "query": [
        {
          "key": "from",
          "value": "1989-05-07",
          "description": "(Required) Start date in 'yyyy-mm-dd' format. The date range defined by the \"from\" and \"to\" parameters should only be one month as the report includes only one month worth of data at once."
        },
        {
          "key": "to",
          "value": "1989-05-07",
          "description": "(Required) End date."
        },
        {
          "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 exceeds the current page size. The expiration period for this token is 15 minutes."
        },
        {
          "key": "type",
          "value": "past",
          "description": "The meeting types: <br>`past` - Past meetings.<br>`pastOne` - Past one user meetings. "
        }
      ],
      "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": "Retrieve [report](https://support.zoom.us/hc/en-us/articles/216378603-Meeting-Reporting) on past meetings and webinars for a specified time period. The time range for the report is limited to a month and the month must fall within the past six months.\n\nMeetings and webinars are returned only if they have two or more unique participants.  <br><br>\n**Scopes:** `report:read:admin`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n**Prerequisites:**<br>\n* Pro or higher plan."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nActive or inactive hosts report returned.<br>\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/users/:userId/meetings?from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit&type=past",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "users",
            ":userId",
            "meetings"
          ],
          "query": [
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "type",
              "value": "past"
            }
          ],
          "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": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "\"{\\n    \\\"from\\\": \\\"2019-07-14\\\",\\n    \\\"to\\\": \\\"2019-08-14\\\",\\n    \\\"page_count\\\": 1,\\n    \\\"page_size\\\": 30,\\n    \\\"total_records\\\": 9,\\n    \\\"next_page_token\\\": \\\"\\\",\\n    \\\"meetings\\\": [\\n        {\\n            \\\"uuid\\\": \\\"/lqsAAAA5VBBBw==\\\",\\n            \\\"id\\\": 12345,\\n            \\\"host_id\\\": \\\"gdfg3434dsssfss\\\",\\n            \\\"type\\\": 2,\\n            \\\"topic\\\": \\\"MyTestMeetings\\\",\\n            \\\"user_name\\\": \\\"Prashant Bhandari\\\",\\n            \\\"user_email\\\": \\\"pb@hjdskfhds.fdskhfhds\\\",\\n            \\\"start_time\\\": \\\"2019-07-15T23:24:52Z\\\",\\n            \\\"end_time\\\": \\\"2019-07-15T23:30:19Z\\\",\\n            \\\"duration\\\": 6,\\n            \\\"total_minutes\\\": 11,\\n            \\\"participants_count\\\": 2\\n        },\\n        {\\n            \\\"uuid\\\": \\\"411bbbbbbcVyw==\\\",\\n            \\\"id\\\": 000000,\\n            \\\"host_id\\\": \\\"gdfg3434dsssfss\\\",\\n            \\\"type\\\": 2,\\n            \\\"topic\\\": \\\"My Meeting\\\",\\n            \\\"user_name\\\": \\\"Raju Khanal\\\",\\n            \\\"user_email\\\": \\\"srhkdjfh@jh.fsadghjm\\\",\\n            \\\"start_time\\\": \\\"2019-07-16T17:14:39Z\\\",\\n            \\\"end_time\\\": \\\"2019-07-16T17:26:20Z\\\",\\n            \\\"duration\\\": 12,\\n            \\\"total_minutes\\\": 17,\\n            \\\"participants_count\\\": 2\\n        }\\n    ]\\n}\""
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request**<br>\n\n**Error Code:** `200`<br>\nThis is only available for paid account:{accountId}.<br>\n\n**Error Code:** `300`<br>\nThe next page token is invalid or expired.\n\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/users/:userId/meetings?from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit&type=past",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "users",
            ":userId",
            "meetings"
          ],
          "query": [
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "type",
              "value": "past"
            }
          ],
          "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**\n<br>**Error Code:** `1001`<br>\nUser {userId} not exist or not belong to this account.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/users/:userId/meetings?from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit&type=past",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "users",
            ":userId",
            "meetings"
          ],
          "query": [
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "type",
              "value": "past"
            }
          ],
          "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": ""
    }
  ]
}