Chilkat Online Tools

SQL Server / Zoom API / Get a meeting

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, 'occurrence_id', 'quis officia in reprehenderit'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'show_previous_occurrences', 'true'

    -- 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/meetings/:meetingId', @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)

    -- {
    --   "agenda": "API overview",
    --   "created_at": "2019-09-09T15:54:24Z",
    --   "duration": 60,
    --   "host_id": "ABcdofjdogh11111",
    --   "id": 1234555466,
    --   "join_url": "https://zoom.us/j/1234555466",
    --   "settings": {
    --     "alternative_hosts": "example@example.com",
    --     "approval_type": 2,
    --     "audio": "both",
    --     "auto_recording": "local",
    --     "close_registration": false,
    --     "cn_meeting": false,
    --     "enforce_login": false,
    --     "enforce_login_domains": "example.com",
    --     "global_dial_in_countries": [
    --       "US"
    --     ],
    --     "global_dial_in_numbers": [
    --       {
    --         "city": "New York",
    --         "country": "US",
    --         "country_name": "US",
    --         "number": "+1 000011100",
    --         "type": "toll"
    --       },
    --       {
    --         "city": "San Jose",
    --         "country": "US",
    --         "country_name": "US",
    --         "number": "+1 6699006833",
    --         "type": "toll"
    --       },
    --       {
    --         "city": "San Jose",
    --         "country": "US",
    --         "country_name": "US",
    --         "number": "+1 221122112211",
    --         "type": "toll"
    --       }
    --     ],
    --     "host_video": false,
    --     "in_meeting": false,
    --     "join_before_host": true,
    --     "mute_upon_entry": false,
    --     "participant_video": false,
    --     "registrants_confirmation_email": true,
    --     "use_pmi": false,
    --     "waiting_room": false,
    --     "watermark": false,
    --     "registrants_email_notification": true
    --   },
    --   "start_time": "2019-08-30T22:00:00Z",
    --   "start_url": "https://zoom.us/1234555466/cdknfdffgggdfg4MDUxNjY0LCJpYXQiOjE1NjgwNDQ0NjQsImFpZCI6IjRBOWR2QkRqVHphd2J0amxoejNQZ1EiLCJjaWQiOiIifQ.Pz_msGuQwtylTtYQ",
    --   "status": "waiting",
    --   "timezone": "America/New_York",
    --   "topic": "My API Test",
    --   "type": 2,
    --   "uuid": "iAABBBcccdddd7A=="
    -- }

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

    DECLARE @strVal nvarchar(4000)

    DECLARE @city nvarchar(4000)

    DECLARE @country nvarchar(4000)

    DECLARE @country_name nvarchar(4000)

    DECLARE @v_number nvarchar(4000)

    DECLARE @v_type_str nvarchar(4000)

    DECLARE @agenda nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @agenda OUT, 'agenda'
    DECLARE @created_at nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @created_at OUT, 'created_at'
    DECLARE @duration int
    EXEC sp_OAMethod @jResp, 'IntOf', @duration OUT, 'duration'
    DECLARE @host_id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @host_id OUT, 'host_id'
    DECLARE @id int
    EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'id'
    DECLARE @join_url nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @join_url OUT, 'join_url'
    DECLARE @Alternative_hosts nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @Alternative_hosts OUT, 'settings.alternative_hosts'
    DECLARE @Approval_type int
    EXEC sp_OAMethod @jResp, 'IntOf', @Approval_type OUT, 'settings.approval_type'
    DECLARE @Audio nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @Audio OUT, 'settings.audio'
    DECLARE @Auto_recording nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @Auto_recording OUT, 'settings.auto_recording'
    DECLARE @Close_registration int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Close_registration OUT, 'settings.close_registration'
    DECLARE @Cn_meeting int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Cn_meeting OUT, 'settings.cn_meeting'
    DECLARE @Enforce_login int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Enforce_login OUT, 'settings.enforce_login'
    DECLARE @Enforce_login_domains nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @Enforce_login_domains OUT, 'settings.enforce_login_domains'
    DECLARE @Host_video int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Host_video OUT, 'settings.host_video'
    DECLARE @In_meeting int
    EXEC sp_OAMethod @jResp, 'BoolOf', @In_meeting OUT, 'settings.in_meeting'
    DECLARE @Join_before_host int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Join_before_host OUT, 'settings.join_before_host'
    DECLARE @Mute_upon_entry int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Mute_upon_entry OUT, 'settings.mute_upon_entry'
    DECLARE @Participant_video int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Participant_video OUT, 'settings.participant_video'
    DECLARE @Registrants_confirmation_email int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Registrants_confirmation_email OUT, 'settings.registrants_confirmation_email'
    DECLARE @Use_pmi int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Use_pmi OUT, 'settings.use_pmi'
    DECLARE @Waiting_room int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Waiting_room OUT, 'settings.waiting_room'
    DECLARE @Watermark int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Watermark OUT, 'settings.watermark'
    DECLARE @Registrants_email_notification int
    EXEC sp_OAMethod @jResp, 'BoolOf', @Registrants_email_notification OUT, 'settings.registrants_email_notification'
    DECLARE @start_time nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @start_time OUT, 'start_time'
    DECLARE @start_url nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @start_url OUT, 'start_url'
    DECLARE @status nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @status OUT, 'status'
    DECLARE @timezone nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @timezone OUT, 'timezone'
    DECLARE @topic nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @topic OUT, 'topic'
    DECLARE @v_type int
    EXEC sp_OAMethod @jResp, 'IntOf', @v_type OUT, 'type'
    DECLARE @uuid nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @uuid OUT, 'uuid'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'settings.global_dial_in_countries'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'settings.global_dial_in_countries[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'settings.global_dial_in_numbers'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @city OUT, 'settings.global_dial_in_numbers[i].city'
        EXEC sp_OAMethod @jResp, 'StringOf', @country OUT, 'settings.global_dial_in_numbers[i].country'
        EXEC sp_OAMethod @jResp, 'StringOf', @country_name OUT, 'settings.global_dial_in_numbers[i].country_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_number OUT, 'settings.global_dial_in_numbers[i].number'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_type_str OUT, 'settings.global_dial_in_numbers[i].type'
        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 "occurrence_id=quis%20officia%20in%20reprehenderit"
	-d "show_previous_occurrences=true"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/meetings/:meetingId

Postman Collection Item JSON

{
  "name": "Get a meeting",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/meetings/:meetingId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "meetings",
        ":meetingId"
      ],
      "query": [
        {
          "key": "occurrence_id",
          "value": "quis officia in reprehenderit",
          "description": "Meeting Occurrence ID. Provide this field to view meeting details of a particular occurrence of the [recurring meeting](https://support.zoom.us/hc/en-us/articles/214973206-Scheduling-Recurring-Meetings)."
        },
        {
          "key": "show_previous_occurrences",
          "value": "true",
          "description": "Set the value of this field to `true` if you would like to view meeting details of all previous occurrences of a [recurring meeting](https://support.zoom.us/hc/en-us/articles/214973206-Scheduling-Recurring-Meetings). "
        }
      ],
      "variable": [
        {
          "key": "meetingId",
          "value": "68423085",
          "description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
        }
      ]
    },
    "description": "Retrieve the details of a meeting.<br><br>\n**Scopes:** `meeting:read:admin` `meeting:read`<br>\n\n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` \n\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nMeeting object returned.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/meetings/:meetingId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "meetings",
            ":meetingId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "meetingId",
              "value": "68423085",
              "description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"agenda\": \"API overview\",\n \"created_at\": \"2019-09-09T15:54:24Z\",\n \"duration\": 60,\n \"host_id\": \"ABcdofjdogh11111\",\n \"id\": 1234555466,\n \"join_url\": \"https://zoom.us/j/1234555466\",\n \"settings\": {\n  \"alternative_hosts\": \"example@example.com\",\n  \"approval_type\": 2,\n  \"audio\": \"both\",\n  \"auto_recording\": \"local\",\n  \"close_registration\": false,\n  \"cn_meeting\": false,\n  \"enforce_login\": false,\n  \"enforce_login_domains\": \"example.com\",\n  \"global_dial_in_countries\": [\n   \"US\"\n  ],\n  \"global_dial_in_numbers\": [\n   {\n    \"city\": \"New York\",\n    \"country\": \"US\",\n    \"country_name\": \"US\",\n    \"number\": \"+1 000011100\",\n    \"type\": \"toll\"\n   },\n   {\n    \"city\": \"San Jose\",\n    \"country\": \"US\",\n    \"country_name\": \"US\",\n    \"number\": \"+1 6699006833\",\n    \"type\": \"toll\"\n   },\n   {\n    \"city\": \"San Jose\",\n    \"country\": \"US\",\n    \"country_name\": \"US\",\n    \"number\": \"+1 221122112211\",\n    \"type\": \"toll\"\n   }\n  ],\n  \"host_video\": false,\n  \"in_meeting\": false,\n  \"join_before_host\": true,\n  \"mute_upon_entry\": false,\n  \"participant_video\": false,\n  \"registrants_confirmation_email\": true,\n  \"use_pmi\": false,\n  \"waiting_room\": false,\n  \"watermark\": false,\n  \"registrants_email_notification\": true\n },\n \"start_time\": \"2019-08-30T22:00:00Z\",\n \"start_url\": \"https://zoom.us/1234555466/cdknfdffgggdfg4MDUxNjY0LCJpYXQiOjE1NjgwNDQ0NjQsImFpZCI6IjRBOWR2QkRqVHphd2J0amxoejNQZ1EiLCJjaWQiOiIifQ.Pz_msGuQwtylTtYQ\",\n \"status\": \"waiting\",\n \"timezone\": \"America/New_York\",\n \"topic\": \"My API Test\",\n \"type\": 2,\n \"uuid\": \"iAABBBcccdddd7A==\"\n}"
    },
    {
      "name": "**HTTP Status Code:** `400`<br>\n**Error Code:** `1010`<br>\nUser not found on this account: {accountId}.<br>**Error Code:** `3000`<br>\nCannot access webinar info.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/meetings/:meetingId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "meetings",
            ":meetingId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "meetingId",
              "value": "68423085",
              "description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nMeeting not found.<br>\n**Error Code:** `1001`<br>\nUser not exist: {userId}.<br>**Error Code:** `3001`<br>\nMeeting {meetingId} is not found or has expired.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/meetings/:meetingId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "meetings",
            ":meetingId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "meetingId",
              "value": "68423085",
              "description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}