Chilkat Online Tools

Swift3 / Zoom API / Get webinar details

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()!
    var success: Bool

    let queryParams = CkoJsonObject()!
    queryParams.update("type", value: "live")

    // Adds the "Authorization: Bearer <access_token>" header.
    http.authToken = "<access_token>"

    var resp: CkoHttpResponse? = http.quickRequestParams("GET", url: "https://api.zoom.us/v2/metrics/webinars/:webinarId", json: queryParams)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    let sbResponseBody = CkoStringBuilder()!
    resp!.getBodySb(sbResponseBody)

    let jResp = CkoJsonObject()!
    jResp.loadSb(sbResponseBody)
    jResp.emitCompact = false

    print("Response Body:")
    print("\(jResp.emit()!)")

    var respStatusCode: Int = resp!.statusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode >= 400 {
        print("Response Header:")
        print("\(resp!.header!)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil

}

Curl Command

curl -G -d "type=live"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/webinars/:webinarId

Postman Collection Item JSON

{
  "name": "Get webinar details",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/metrics/webinars/:webinarId?type=live",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "metrics",
        "webinars",
        ":webinarId"
      ],
      "query": [
        {
          "key": "type",
          "value": "live",
          "description": "The type of webinar to query: \n* `past` — All past webinars. \n* `live` - All live webinars. \n\nThis value defaults to `live`."
        }
      ],
      "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 details from live or past webinars.<br><br>\n**Scopes:** `dashboard_webinars: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, Education or API Plan with Webinar add-on.\n\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nWebinar details returned.<br>\nOnly available for paid accounts that have enabled the Dashboard feature.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/webinars/:webinarId?type=live",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            }
          ],
          "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\\\": \\\"CJaaaaaaaEV6A==\\\",\\n    \\\"id\\\": 00001,\\n    \\\"topic\\\": \\\"MyTestWebinar\\\",\\n    \\\"host\\\": \\\"Henry Chao\\\",\\n    \\\"email\\\": \\\"hc@sdfdfdsfdfsdf.com\\\",\\n    \\\"user_type\\\": \\\"Pro|Webinar1000\\\",\\n    \\\"start_time\\\": \\\"2019-07-16T17:14:39Z\\\",\\n    \\\"end_time\\\": \\\"2019-07-16T17:26:20Z\\\",\\n    \\\"duration\\\": 12,\\n    \\\"participants\\\": 1,\\n    \\\"has_pstn\\\": false,\\n    \\\"has_voip\\\": false,\\n    \\\"has_3rd_party_audio\\\": false,\\n    \\\"has_video\\\": false,\\n    \\\"has_screen_share\\\": false,\\n    \\\"has_recording\\\": false,\\n    \\\"has_sip\\\": false\\n    \\\"has_archiving\\\": false\\n}\""
    },
    {
      "name": "**Error Code:** `200`<br>\nCan not access webinar info, {webinarId}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/webinars/:webinarId?type=live",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            }
          ],
          "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:** `404`<br>\n**Error Code:** `3001`<br>\nThe webinar has not ended yet or the Webinar ID is not valid.<br>\nThis webinar's detail is not available.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/webinars/:webinarId?type=live",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            }
          ],
          "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": ""
    }
  ]
}