Chilkat Online Tools

SQL Server / Zoom API / Get meeting archived files

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
    -- 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

    -- Adds the "Authorization: Bearer <access_token>" header.
    EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'

    DECLARE @sbResponseBody int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://api.zoom.us/v2/past_meetings/:meetingUUID/archive_files', @sbResponseBody
    IF @success = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        RETURN
      END

    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 @http, 'LastStatus', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END

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

    -- {
    --   "uuid": "yVaEafxxRN+tiOZUSWKJVw==",
    --   "id": 4554919265,
    --   "host_id": "7pTFNV2SS0i0LKfQhmMyHQ",
    --   "topic": "ZOOM_API Test's Personal Meeting Room",
    --   "type": 4,
    --   "start_time": "2021-04-26T05:23:18Z",
    --   "timezone": "Asia/Shanghai",
    --   "duration": 1,
    --   "total_size": 2676453,
    --   "recording_count": 2,
    --   "meeting_type": "internal",
    --   "account_name": "account_01",
    --   "complete_time": "2021-03-12T02:57:27Z",
    --   "is_breakout_room": false,
    --   "archive_files": [
    --     {
    --       "id": "20d04c59-df9a-442b-9a3d-570884bede07",
    --       "file_type": "MP4",
    --       "file_extension": "MP4",
    --       "file_size": 1434664,
    --       "download_url": "https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngBBBB",
    --       "status": "completed",
    --       "recording_type": "shared_screen_with_speaker_view",
    --       "individual": true,
    --       "participant_email": "user@example.com",
    --       "participant_join_time": "2021-03-12T02:07:27Z",
    --       "participant_leave_time": "2021-03-12T02:12:27Z"
    --     },
    --     {
    --       "id": "83cc23a5-3a35-44e2-87b3-a2b5a4dac6f8",
    --       "file_type": "M4A",
    --       "file_extension": "M4A",
    --       "file_size": 1241789,
    --       "download_url": "https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngCCCC",
    --       "status": "completed",
    --       "recording_type": "audio_only",
    --       "individual": true,
    --       "participant_email": "user1@example.com",
    --       "participant_join_time": "2021-03-12T02:07:27Z",
    --       "participant_leave_time": "2021-03-12T02:12:27Z"
    --     }
    --   ]
    -- }

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

    DECLARE @id_str nvarchar(4000)

    DECLARE @file_type nvarchar(4000)

    DECLARE @file_extension nvarchar(4000)

    DECLARE @file_size int

    DECLARE @download_url nvarchar(4000)

    DECLARE @status nvarchar(4000)

    DECLARE @recording_type nvarchar(4000)

    DECLARE @individual int

    DECLARE @participant_email nvarchar(4000)

    DECLARE @participant_join_time nvarchar(4000)

    DECLARE @participant_leave_time nvarchar(4000)

    DECLARE @uuid nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @uuid OUT, 'uuid'
    DECLARE @id int
    EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'id'
    DECLARE @host_id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @host_id OUT, 'host_id'
    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 @start_time nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @start_time OUT, 'start_time'
    DECLARE @timezone nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @timezone OUT, 'timezone'
    DECLARE @duration int
    EXEC sp_OAMethod @jResp, 'IntOf', @duration OUT, 'duration'
    DECLARE @total_size int
    EXEC sp_OAMethod @jResp, 'IntOf', @total_size OUT, 'total_size'
    DECLARE @recording_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @recording_count OUT, 'recording_count'
    DECLARE @meeting_type nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @meeting_type OUT, 'meeting_type'
    DECLARE @account_name nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @account_name OUT, 'account_name'
    DECLARE @complete_time nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @complete_time OUT, 'complete_time'
    DECLARE @is_breakout_room int
    EXEC sp_OAMethod @jResp, 'BoolOf', @is_breakout_room OUT, 'is_breakout_room'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'archive_files'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @id_str OUT, 'archive_files[i].id'
        EXEC sp_OAMethod @jResp, 'StringOf', @file_type OUT, 'archive_files[i].file_type'
        EXEC sp_OAMethod @jResp, 'StringOf', @file_extension OUT, 'archive_files[i].file_extension'
        EXEC sp_OAMethod @jResp, 'IntOf', @file_size OUT, 'archive_files[i].file_size'
        EXEC sp_OAMethod @jResp, 'StringOf', @download_url OUT, 'archive_files[i].download_url'
        EXEC sp_OAMethod @jResp, 'StringOf', @status OUT, 'archive_files[i].status'
        EXEC sp_OAMethod @jResp, 'StringOf', @recording_type OUT, 'archive_files[i].recording_type'
        EXEC sp_OAMethod @jResp, 'BoolOf', @individual OUT, 'archive_files[i].individual'
        EXEC sp_OAMethod @jResp, 'StringOf', @participant_email OUT, 'archive_files[i].participant_email'
        EXEC sp_OAMethod @jResp, 'StringOf', @participant_join_time OUT, 'archive_files[i].participant_join_time'
        EXEC sp_OAMethod @jResp, 'StringOf', @participant_leave_time OUT, 'archive_files[i].participant_leave_time'
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/past_meetings/:meetingUUID/archive_files

Postman Collection Item JSON

{
  "name": "Get meeting archived files",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/past_meetings/:meetingUUID/archive_files",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "past_meetings",
        ":meetingUUID",
        "archive_files"
      ],
      "variable": [
        {
          "key": "meetingUUID",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The meeting's universally unique identifier (UUID). Each meeting instance generates a UUID. For example, after a meeting ends, a new UUID is generated for the next meeting instance.\n\nIf the meeting UUID begins with a `/` character or contains a `//` character, you **must** double-encode the meeting UUID when using the meeting UUID for other API calls."
        }
      ]
    },
    "description": "List the archived recording files of the specific meeting instance. For more information, read our [Managing archiving of meeting and webinar data](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data) documentation.\n\n**Scopes:** `recording:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`\n\n**Prerequisites:** \n* Follow the [enablement process](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data#h_01ENPBD3WR68D7FAKTBY92SG45) to access the archiving feature."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200` **OK**\nMeeting with Archived files returned.\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/past_meetings/:meetingUUID/archive_files",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "past_meetings",
            ":meetingUUID",
            "archive_files"
          ],
          "variable": [
            {
              "key": "meetingUUID",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The meeting's universally unique identifier (UUID). Each meeting instance generates a UUID. For example, after a meeting ends, a new UUID is generated for the next meeting instance.\n\nIf the meeting UUID begins with a `/` character or contains a `//` character, you **must** double-encode the meeting UUID when using the meeting UUID for other API calls."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"uuid\": \"yVaEafxxRN+tiOZUSWKJVw==\",\n \"id\": 4554919265,\n \"host_id\": \"7pTFNV2SS0i0LKfQhmMyHQ\",\n \"topic\": \"ZOOM_API Test's Personal Meeting Room\",\n \"type\": 4,\n \"start_time\": \"2021-04-26T05:23:18Z\",\n \"timezone\": \"Asia/Shanghai\",\n \"duration\": 1,\n \"total_size\": 2676453,\n \"recording_count\": 2,\n \"meeting_type\": \"internal\",\n \"account_name\": \"account_01\",\n \"complete_time\": \"2021-03-12T02:57:27Z\",\n \"is_breakout_room\": false,\n \"archive_files\": [\n  {\n   \"id\": \"20d04c59-df9a-442b-9a3d-570884bede07\",\n   \"file_type\": \"MP4\",\n   \"file_extension\": \"MP4\",\n   \"file_size\": 1434664,\n   \"download_url\": \"https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngBBBB\",\n   \"status\": \"completed\",\n   \"recording_type\": \"shared_screen_with_speaker_view\",\n   \"individual\": true,\n   \"participant_email\": \"user@example.com\",\n   \"participant_join_time\": \"2021-03-12T02:07:27Z\",\n   \"participant_leave_time\": \"2021-03-12T02:12:27Z\"\n  },\n  {\n   \"id\": \"83cc23a5-3a35-44e2-87b3-a2b5a4dac6f8\",\n   \"file_type\": \"M4A\",\n   \"file_extension\": \"M4A\",\n   \"file_size\": 1241789,\n   \"download_url\": \"https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngCCCC\",\n   \"status\": \"completed\",\n   \"recording_type\": \"audio_only\",\n   \"individual\": true,\n   \"participant_email\": \"user1@example.com\",\n   \"participant_join_time\": \"2021-03-12T02:07:27Z\",\n   \"participant_leave_time\": \"2021-03-12T02:12:27Z\"\n  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nMeeting recording not found.<br>\n**Error Code:** `3001`<br>\nMeeting {meetingUUId} does not exist.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/past_meetings/:meetingUUID/archive_files",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "past_meetings",
            ":meetingUUID",
            "archive_files"
          ],
          "variable": [
            {
              "key": "meetingUUID",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The meeting's universally unique identifier (UUID). Each meeting instance generates a UUID. For example, after a meeting ends, a new UUID is generated for the next meeting instance.\n\nIf the meeting UUID begins with a `/` character or contains a `//` character, you **must** double-encode the meeting UUID when using the meeting UUID for other API calls."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}