Chilkat Online Tools

SQL Server / Zoom API / List meetings

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
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @queryParams int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @queryParams OUT

    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'type', 'live'
    EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'page_size', 30
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'next_page_token', 'quis officia in reprehenderit'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'page_number', 'quis officia in reprehenderit'

    -- 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/meetings', @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
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.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

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

    -- {
    --   "page_count": 1,
    --   "page_number": 1,
    --   "page_size": 30,
    --   "total_records": 4,
    --   "meetings": [
    --     {
    --       "uuid": "mlghmfghlBBB",
    --       "id": 11111,
    --       "host_id": "abckjdfhsdkjf",
    --       "topic": "Zoom Meeting",
    --       "type": 2,
    --       "start_time": "2019-08-16T02:00:00Z",
    --       "duration": 30,
    --       "timezone": "America/Los_Angeles",
    --       "created_at": "2019-08-16T01:13:12Z",
    --       "join_url": "https://zoom.us/j/11111"
    --     },
    --     {
    --       "uuid": "J8H8eavweUcd321==",
    --       "id": 2222,
    --       "host_id": "abckjdfhsdkjf",
    --       "topic": "TestMeeting",
    --       "type": 2,
    --       "start_time": "2019-08-16T19:00:00Z",
    --       "duration": 60,
    --       "timezone": "America/Los_Angeles",
    --       "agenda": "RegistrationDeniedTest",
    --       "created_at": "2019-08-16T18:30:46Z",
    --       "join_url": "https://zoom.us/j/2222"
    --     },
    --     {
    --       "uuid": "SGVTAcfSfCbbbb",
    --       "id": 33333,
    --       "host_id": "abckjdfhsdkjf",
    --       "topic": "My Meeting",
    --       "type": 2,
    --       "start_time": "2019-08-16T22:00:00Z",
    --       "duration": 60,
    --       "timezone": "America/Los_Angeles",
    --       "created_at": "2019-08-16T21:15:56Z",
    --       "join_url": "https://zoom.us/j/33333"
    --     },
    --     {
    --       "uuid": "64123avdfsMVA==",
    --       "id": 44444,
    --       "host_id": "abckjdfhsdkjf",
    --       "topic": "MyTestPollMeeting",
    --       "type": 2,
    --       "start_time": "2019-08-29T18:00:00Z",
    --       "duration": 60,
    --       "timezone": "America/Los_Angeles",
    --       "created_at": "2019-08-29T17:32:33Z",
    --       "join_url": "https://zoom.us/j/4444"
    --     }
    --   ]
    -- }

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

    DECLARE @uuid nvarchar(4000)

    DECLARE @id int

    DECLARE @host_id nvarchar(4000)

    DECLARE @topic nvarchar(4000)

    DECLARE @v_type int

    DECLARE @start_time nvarchar(4000)

    DECLARE @duration int

    DECLARE @timezone nvarchar(4000)

    DECLARE @created_at nvarchar(4000)

    DECLARE @join_url nvarchar(4000)

    DECLARE @agenda nvarchar(4000)

    DECLARE @page_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @page_count OUT, 'page_count'
    DECLARE @page_number int
    EXEC sp_OAMethod @jResp, 'IntOf', @page_number OUT, 'page_number'
    DECLARE @page_size int
    EXEC sp_OAMethod @jResp, 'IntOf', @page_size OUT, 'page_size'
    DECLARE @total_records int
    EXEC sp_OAMethod @jResp, 'IntOf', @total_records OUT, 'total_records'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'meetings'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @uuid OUT, 'meetings[i].uuid'
        EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'meetings[i].id'
        EXEC sp_OAMethod @jResp, 'StringOf', @host_id OUT, 'meetings[i].host_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @topic OUT, 'meetings[i].topic'
        EXEC sp_OAMethod @jResp, 'IntOf', @v_type OUT, 'meetings[i].type'
        EXEC sp_OAMethod @jResp, 'StringOf', @start_time OUT, 'meetings[i].start_time'
        EXEC sp_OAMethod @jResp, 'IntOf', @duration OUT, 'meetings[i].duration'
        EXEC sp_OAMethod @jResp, 'StringOf', @timezone OUT, 'meetings[i].timezone'
        EXEC sp_OAMethod @jResp, 'StringOf', @created_at OUT, 'meetings[i].created_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @join_url OUT, 'meetings[i].join_url'
        EXEC sp_OAMethod @jResp, 'StringOf', @agenda OUT, 'meetings[i].agenda'
        SELECT @i = @i + 1
      END

    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 "type=live"
	-d "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-d "page_number=quis%20officia%20in%20reprehenderit"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/users/:userId/meetings

Postman Collection Item JSON

{
  "name": "List meetings",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/users/:userId/meetings?type=live&page_size=30&next_page_token=quis officia in reprehenderit&page_number=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users",
        ":userId",
        "meetings"
      ],
      "query": [
        {
          "key": "type",
          "value": "live",
          "description": "The meeting types: <br>`scheduled` - This includes all valid past meetings (unexpired), live meetings and upcoming scheduled meetings. It is equivalent to the combined list of \"Previous Meetings\" and \"Upcoming Meetings\" displayed in the user's [Meetings page](https://zoom.us/meeting) on the Zoom Web Portal.<br>`live` - All the ongoing meetings.<br>`upcoming` - All upcoming meetings including live meetings."
        },
        {
          "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": "page_number",
          "value": "quis officia in reprehenderit",
          "description": "The page number of the current page in the returned records."
        }
      ],
      "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": "List all the meetings that were scheduled for a user (meeting 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\nThis API **only** supports scheduled meetings. This API does not return information about instant meetings.\n\n**Scopes:** `meeting:read:admin`, `meeting:read`</br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nList of meeting objects returned.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId/meetings?type=live&page_size=30&next_page_token=quis officia in reprehenderit&page_number=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "meetings"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "page_number",
              "value": "quis officia in reprehenderit"
            }
          ],
          "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\": 4,\n \"meetings\": [\n  {\n   \"uuid\": \"mlghmfghlBBB\",\n   \"id\": 11111,\n   \"host_id\": \"abckjdfhsdkjf\",\n   \"topic\": \"Zoom Meeting\",\n   \"type\": 2,\n   \"start_time\": \"2019-08-16T02:00:00Z\",\n   \"duration\": 30,\n   \"timezone\": \"America/Los_Angeles\",\n   \"created_at\": \"2019-08-16T01:13:12Z\",\n   \"join_url\": \"https://zoom.us/j/11111\"\n  },\n  {\n   \"uuid\": \"J8H8eavweUcd321==\",\n   \"id\": 2222,\n   \"host_id\": \"abckjdfhsdkjf\",\n   \"topic\": \"TestMeeting\",\n   \"type\": 2,\n   \"start_time\": \"2019-08-16T19:00:00Z\",\n   \"duration\": 60,\n   \"timezone\": \"America/Los_Angeles\",\n   \"agenda\": \"RegistrationDeniedTest\",\n   \"created_at\": \"2019-08-16T18:30:46Z\",\n   \"join_url\": \"https://zoom.us/j/2222\"\n  },\n  {\n   \"uuid\": \"SGVTAcfSfCbbbb\",\n   \"id\": 33333,\n   \"host_id\": \"abckjdfhsdkjf\",\n   \"topic\": \"My Meeting\",\n   \"type\": 2,\n   \"start_time\": \"2019-08-16T22:00:00Z\",\n   \"duration\": 60,\n   \"timezone\": \"America/Los_Angeles\",\n   \"created_at\": \"2019-08-16T21:15:56Z\",\n   \"join_url\": \"https://zoom.us/j/33333\"\n  },\n  {\n   \"uuid\": \"64123avdfsMVA==\",\n   \"id\": 44444,\n   \"host_id\": \"abckjdfhsdkjf\",\n   \"topic\": \"MyTestPollMeeting\",\n   \"type\": 2,\n   \"start_time\": \"2019-08-29T18:00:00Z\",\n   \"duration\": 60,\n   \"timezone\": \"America/Los_Angeles\",\n   \"created_at\": \"2019-08-29T17:32:33Z\",\n   \"join_url\": \"https://zoom.us/j/4444\"\n  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nUser ID not found.<br>\n**Error Code:** `1001`<br>\nUser {userId} not exist or not belong to this account.<br>",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId/meetings?type=live&page_size=30&next_page_token=quis officia in reprehenderit&page_number=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "meetings"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "page_number",
              "value": "quis officia in reprehenderit"
            }
          ],
          "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": ""
    }
  ]
}