Chilkat Online Tools

PureBasic / Zoom API / Get webinar detail reports

Back to Collection Items

IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    ; Adds the "Authorization: Bearer <access_token>" header.
    CkHttp::setCkAuthToken(http, "<access_token>")

    sbResponseBody.i = CkStringBuilder::ckCreate()
    If sbResponseBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success = CkHttp::ckQuickGetSb(http,"https://api.zoom.us/v2/report/webinars/:webinarId",sbResponseBody)
    If success = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        CkStringBuilder::ckDispose(sbResponseBody)
        ProcedureReturn
    EndIf

    jResp.i = CkJsonObject::ckCreate()
    If jResp.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckLoadSb(jResp,sbResponseBody)
    CkJsonObject::setCkEmitCompact(jResp, 0)

    Debug "Response Body:"
    Debug CkJsonObject::ckEmit(jResp)

    respStatusCode.i = CkHttp::ckLastStatus(http)
    Debug "Response Status Code = " + Str(respStatusCode)
    If respStatusCode >= 400
        Debug "Response Header:"
        Debug CkHttp::ckLastHeader(http)
        Debug "Failed."
        CkHttp::ckDispose(http)
        CkStringBuilder::ckDispose(sbResponseBody)
        CkJsonObject::ckDispose(jResp)
        ProcedureReturn
    EndIf

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

    ; {
    ;   "uuid": "urn4fe6caeb98",
    ;   "id": 51788617,
    ;   "type": 5,
    ;   "topic": "My Health Webinar",
    ;   "user_name": "Utfdfdget",
    ;   "user_email": "example@example.com",
    ;   "start_time": "2019-11-18T03:15:00.056Z",
    ;   "end_time": "2019-11-18T03:15:20.056Z",
    ;   "duration": 20,
    ;   "total_minutes": 10,
    ;   "participants_count": 13,
    ;   "tracking_fields": [
    ;     {
    ;       "field": "Webinar Purpose",
    ;       "value": "Health awareness"
    ;     }
    ;   ]
    ; }

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

    field.s
    value.s

    uuid.s = CkJsonObject::ckStringOf(jResp,"uuid")
    id.i = CkJsonObject::ckIntOf(jResp,"id")
    v_type.i = CkJsonObject::ckIntOf(jResp,"type")
    topic.s = CkJsonObject::ckStringOf(jResp,"topic")
    user_name.s = CkJsonObject::ckStringOf(jResp,"user_name")
    user_email.s = CkJsonObject::ckStringOf(jResp,"user_email")
    start_time.s = CkJsonObject::ckStringOf(jResp,"start_time")
    end_time.s = CkJsonObject::ckStringOf(jResp,"end_time")
    duration.i = CkJsonObject::ckIntOf(jResp,"duration")
    total_minutes.i = CkJsonObject::ckIntOf(jResp,"total_minutes")
    participants_count.i = CkJsonObject::ckIntOf(jResp,"participants_count")
    i.i = 0
    count_i.i = CkJsonObject::ckSizeOfArray(jResp,"tracking_fields")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        field = CkJsonObject::ckStringOf(jResp,"tracking_fields[i].field")
        value = CkJsonObject::ckStringOf(jResp,"tracking_fields[i].value")
        i = i + 1
    Wend


    CkHttp::ckDispose(http)
    CkStringBuilder::ckDispose(sbResponseBody)
    CkJsonObject::ckDispose(jResp)


    ProcedureReturn
EndProcedure

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/report/webinars/:webinarId

Postman Collection Item JSON

{
  "name": "Get webinar detail reports",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/report/webinars/:webinarId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "report",
        "webinars",
        ":webinarId"
      ],
      "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": "Retrieve a [report](https://support.zoom.us/hc/en-us/articles/201393719-Webinar-Reporting) containing past webinar details.  <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 with Webinar add-on."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nWebinar details 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",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId"
          ],
          "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 \"uuid\": \"urn4fe6caeb98\",\n \"id\": 51788617,\n \"type\": 5,\n \"topic\": \"My Health Webinar\",\n \"user_name\": \"Utfdfdget\",\n \"user_email\": \"example@example.com\",\n \"start_time\": \"2019-11-18T03:15:00.056Z\",\n \"end_time\": \"2019-11-18T03:15:20.056Z\",\n \"duration\": 20,\n \"total_minutes\": 10,\n \"participants_count\": 13,\n \"tracking_fields\": [\n  {\n   \"field\": \"Webinar Purpose\",\n   \"value\": \"Health awareness\"\n  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `300`<br>\nCan not access 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",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId"
          ],
          "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",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId"
          ],
          "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>\nMeeting  {meetingId} 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",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "webinars",
            ":webinarId"
          ],
          "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": ""
    }
  ]
}