SQL Server / Zoom API / List webinars
Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
DECLARE @queryParams int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT
EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'page_size', 30
EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'page_number', 1
-- Adds the "Authorization: Bearer <access_token>" header.
EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'
DECLARE @resp int
EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://api.zoom.us/v2/users/:userId/webinars', @queryParams
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
RETURN
END
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody
DECLARE @jResp int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
EXEC sp_OASetProperty @jResp, 'EmitCompact', 0
PRINT 'Response Body:'
EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
PRINT @sTmp0
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode >= 400
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
RETURN
END
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO
Curl Command
curl -G -d "page_size=30"
-d "page_number=1"
-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/users/:userId/webinars
Postman Collection Item JSON
{
"name": "List webinars",
"request": {
"auth": {
"type": "oauth2"
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/users/:userId/webinars?page_size=30&page_number=1",
"host": [
"{{baseUrl}}"
],
"path": [
"users",
":userId",
"webinars"
],
"query": [
{
"key": "page_size",
"value": "30",
"description": "The number of records returned within a single API call."
},
{
"key": "page_number",
"value": "1",
"description": "**Deprecated.** We will no longer support this field in a future release. Instead, use the `next_page_token` for pagination."
}
],
"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": "Use this API to list all the webinars that are scheduled by or on-behalf a user (webinar host). For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.\n\nZoom users with a [Webinar Plan](https://zoom.us/webinar) have access to creating and managing webinars. Webinars allow a host to broadcast a Zoom meeting to up to 10,000 attendees.\n\n**Scopes:** `webinar:read:admin`, `webinar:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`\n\n**Prerequisites:**\n* Pro or higher plan with a Webinar Add-on."
},
"response": [
{
"name": "**HTTP Status Code:** `200`<br>\nList of webinar objects returned.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/users/:userId/webinars?page_size=30&page_number=1",
"host": [
"{{baseUrl}}"
],
"path": [
"users",
":userId",
"webinars"
],
"query": [
{
"key": "page_size",
"value": "30"
},
{
"key": "page_number",
"value": "1"
}
],
"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 \\\"page_count\\\": \\\"1\\\",\\n \\\"page_number\\\": \\\"1\\\",\\n \\\"page_size\\\": \\\"30\\\",\\n \\\"total_records\\\": \\\"1\\\",\\n \\\"webinars\\\": [\\n {\\n \\\"uuid\\\": \\\"dsghfkhaewfds\\\",\\n \\\"id\\\": 0001000,\\n \\\"host_id\\\": \\\"24654130000000\\\",\\n \\\"topic\\\": \\\"My Webinar\\\",\\n \\\"agenda\\\": \\\"Learn more about Zoom APIs\\\",\\n \\\"type\\\": \\\"5\\\",\\n \\\"duration\\\": \\\"60\\\",\\n \\\"start_time\\\": \\\"2019-09-24T22:00:00Z\\\",\\n \\\"timezone\\\": \\\"America/Los_Angeles\\\",\\n \\\"created_at\\\": \\\"2019-08-30T22:00:00Z\\\",\\n \\\"join_url\\\": \\\"https://zoom.us/0001000/awesomewebinar\\\"\\n }\\n ]\\n}\""
},
{
"name": "**HTTP Status Code:** `404` **Not Found**<br><br>\n**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}}/users/:userId/webinars?page_size=30&page_number=1",
"host": [
"{{baseUrl}}"
],
"path": [
"users",
":userId",
"webinars"
],
"query": [
{
"key": "page_size",
"value": "30"
},
{
"key": "page_number",
"value": "1"
}
],
"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": ""
}
]
}