Chilkat Online Tools

DataFlex / Zoom API / Get webinar participant reports

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sId
    String sUser_id
    String sName
    String sUser_email
    String sJoin_time
    String sLeave_time
    String sDuration
    String sPage_count
    String sPage_size
    String sTotal_records
    String sNext_page_token
    Integer i
    Integer iCount_i
    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

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateInt Of hoQueryParams "page_size" 30 To iSuccess
    Get ComUpdateString Of hoQueryParams "next_page_token" "quis officia in reprehenderit" To iSuccess
    Get ComUpdateString Of hoQueryParams "include_fields" "registrant_id" To iSuccess

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

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://api.zoom.us/v2/report/webinars/:webinarId/participants" vQueryParams 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 Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

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

    Send Destroy of hoResp

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "page_count": "1",
    //   "page_size": "30",
    //   "total_records": "1",
    //   "next_page_token": "",
    //   "participants": [
    //     {
    //       "id": "dskfjladjskfl",
    //       "user_id": "sdfjkldsfdfgdfg",
    //       "name": "Riya",
    //       "user_email": "example@example.com",
    //       "join_time": "2019-02-01T12:34:12.660Z",
    //       "leave_time": "2019-03-01T12:34:12.660Z",
    //       "duration": "20"
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    Get ComStringOf Of hoJResp "page_count" To sPage_count
    Get ComStringOf Of hoJResp "page_size" To sPage_size
    Get ComStringOf Of hoJResp "total_records" To sTotal_records
    Get ComStringOf Of hoJResp "next_page_token" To sNext_page_token
    Move 0 To i
    Get ComSizeOfArray Of hoJResp "participants" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "participants[i].id" To sId
        Get ComStringOf Of hoJResp "participants[i].user_id" To sUser_id
        Get ComStringOf Of hoJResp "participants[i].name" To sName
        Get ComStringOf Of hoJResp "participants[i].user_email" To sUser_email
        Get ComStringOf Of hoJResp "participants[i].join_time" To sJoin_time
        Get ComStringOf Of hoJResp "participants[i].leave_time" To sLeave_time
        Get ComStringOf Of hoJResp "participants[i].duration" To sDuration
        Move (i + 1) To i
    Loop



End_Procedure

Curl Command

curl -G -d "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-d "include_fields=registrant_id"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/report/webinars/:webinarId/participants

Postman Collection Item JSON

{
  "name": "Get webinar participant reports",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/report/webinars/:webinarId/participants?page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "report",
        "webinars",
        ":webinarId",
        "participants"
      ],
      "query": [
        {
          "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": "include_fields",
          "value": "registrant_id",
          "description": "Enter 'registrant_id' as the value for this field if you would like to see the registrant ID attribute included in the response of this API call. A registrant ID is a unique identifier of a [webinar registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrants).<br>\n\n"
        }
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
        }
      ]
    },
    "description": "Get detailed report on each attendee of a webinar.<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 a higher plan with Webinar add-on enabled."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nMeeting participants report returned.<br>\nThis is only available for paid account: {accountId}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/webinars/:webinarId/participants?page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId",
            "participants"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar 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\": \"1\",\n \"page_size\": \"30\",\n \"total_records\": \"1\",\n \"next_page_token\": \"\",\n \"participants\": [\n  {\n   \"id\": \"dskfjladjskfl\",\n   \"user_id\": \"sdfjkldsfdfgdfg\",\n   \"name\": \"Riya\",\n   \"user_email\": \"example@example.com\",\n   \"join_time\": \"2019-02-01T12:34:12.660Z\",\n   \"leave_time\": \"2019-03-01T12:34:12.660Z\",\n   \"duration\": \"20\"\n  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `300`<br>\nThe next page token is invalid or has expired.<br>\nCan not access the webinar information, {webinarId}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/webinars/:webinarId/participants?page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId",
            "participants"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar 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:** `400`<br>\nBad request<br>\n**Error Code:** `1010`<br>\nUser does not belong to this account:{accountId}.<br>",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/webinars/:webinarId/participants?page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId",
            "participants"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nWebinar ID not found.<br>\n**Error Code:** `3001`<br>\nWebinar  {webinarId} not found or has expired.<br>",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/webinars/:webinarId/participants?page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId",
            "participants"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}