Chilkat Online Tools

SQL Server / Zoom API / List all recordings

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, '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, 'mc', 'false'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'trash', 'false'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'from', '1989-05-07'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'to', '1989-05-07'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'trash_type', 'meeting_recordings'
    EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'meeting_id', 68423085

    -- 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/recordings', @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)

    -- {
    --   "from": "2019-08-15",
    --   "to": "2019-09-15",
    --   "page_count": 1,
    --   "page_size": 30,
    --   "total_records": 1,
    --   "next_page_token": "",
    --   "meetings": [
    --     {
    --       "uuid": "gkABCDEnCkPuA==",
    --       "id": 1000000000000,
    --       "account_id": "AbcjxkfhdEEE",
    --       "host_id": "z8dfkgABBBBBBBfp8uQ",
    --       "topic": "MyTestPollMeeting",
    --       "type": 2,
    --       "start_time": "2019-08-29T21:54:49Z",
    --       "timezone": "America/Los_Angeles",
    --       "duration": 1,
    --       "total_size": 47383,
    --       "recording_count": 1,
    --       "share_url": "https://api.zoom.us/recording/share/IABCDJDKDJEEEEEk_GwfdggdgkTziMw",
    --       "recording_files": [
    --         {
    --           "id": "589ABBBBB-8718e",
    --           "meeting_id": "gkABCDEnCkPuA==",
    --           "recording_start": "2019-08-29T21:54:55Z",
    --           "recording_end": "2019-08-29T21:55:24Z",
    --           "file_type": "M4A",
    --           "file_size": 10098,
    --           "play_url": "https://api.zoom.us/recording/play/pfA2AvvvvvAnAzOibbbbELxl",
    --           "download_url": "https://api.zoom.us/recording/download/pfA2AvvvvvAnAzOibbbbELxl",
    --           "status": "completed",
    --           "recording_type": "audio_only"
    --         },
    --         {
    --           "meeting_id": "gkABCDEnCkPuA==",
    --           "recording_start": "2019-08-29T21:54:55Z",
    --           "recording_end": "2019-08-29T21:55:24Z",
    --           "file_type": "TIMELINE",
    --           "download_url": "https://api.zoom.us/recording/download/cc33ekldfdjfhf3-aaaaa"
    --         },
    --         {
    --           "id": "96119b=kdfhf791",
    --           "meeting_id": "gkABCDEnCkPuA==",
    --           "recording_start": "2019-08-29T21:54:55Z",
    --           "recording_end": "2019-08-29T21:55:24Z",
    --           "file_type": "MP4",
    --           "file_size": 37285,
    --           "play_url": "https://api.zoom.us/recording/play/abcdkjfhdhfdhfj",
    --           "download_url": "https://api.zoom.us/recording/download/abcdkjfhdhfdhfj",
    --           "status": "completed",
    --           "recording_type": "shared_screen_with_speaker_view"
    --         }
    --       ]
    --     }
    --   ]
    -- }

    -- 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 @account_id nvarchar(4000)

    DECLARE @host_id nvarchar(4000)

    DECLARE @topic nvarchar(4000)

    DECLARE @v_type int

    DECLARE @start_time nvarchar(4000)

    DECLARE @timezone nvarchar(4000)

    DECLARE @duration int

    DECLARE @total_size int

    DECLARE @recording_count int

    DECLARE @share_url nvarchar(4000)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @id_str nvarchar(4000)

    DECLARE @meeting_id nvarchar(4000)

    DECLARE @recording_start nvarchar(4000)

    DECLARE @recording_end nvarchar(4000)

    DECLARE @file_type nvarchar(4000)

    DECLARE @file_size int

    DECLARE @play_url nvarchar(4000)

    DECLARE @download_url nvarchar(4000)

    DECLARE @status nvarchar(4000)

    DECLARE @recording_type nvarchar(4000)

    DECLARE @from nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @from OUT, 'from'
    DECLARE @v_to nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @v_to OUT, 'to'
    DECLARE @page_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @page_count OUT, 'page_count'
    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 @next_page_token nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @next_page_token OUT, 'next_page_token'
    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', @account_id OUT, 'meetings[i].account_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, 'StringOf', @timezone OUT, 'meetings[i].timezone'
        EXEC sp_OAMethod @jResp, 'IntOf', @duration OUT, 'meetings[i].duration'
        EXEC sp_OAMethod @jResp, 'IntOf', @total_size OUT, 'meetings[i].total_size'
        EXEC sp_OAMethod @jResp, 'IntOf', @recording_count OUT, 'meetings[i].recording_count'
        EXEC sp_OAMethod @jResp, 'StringOf', @share_url OUT, 'meetings[i].share_url'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'meetings[i].recording_files'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @id_str OUT, 'meetings[i].recording_files[j].id'
            EXEC sp_OAMethod @jResp, 'StringOf', @meeting_id OUT, 'meetings[i].recording_files[j].meeting_id'
            EXEC sp_OAMethod @jResp, 'StringOf', @recording_start OUT, 'meetings[i].recording_files[j].recording_start'
            EXEC sp_OAMethod @jResp, 'StringOf', @recording_end OUT, 'meetings[i].recording_files[j].recording_end'
            EXEC sp_OAMethod @jResp, 'StringOf', @file_type OUT, 'meetings[i].recording_files[j].file_type'
            EXEC sp_OAMethod @jResp, 'IntOf', @file_size OUT, 'meetings[i].recording_files[j].file_size'
            EXEC sp_OAMethod @jResp, 'StringOf', @play_url OUT, 'meetings[i].recording_files[j].play_url'
            EXEC sp_OAMethod @jResp, 'StringOf', @download_url OUT, 'meetings[i].recording_files[j].download_url'
            EXEC sp_OAMethod @jResp, 'StringOf', @status OUT, 'meetings[i].recording_files[j].status'
            EXEC sp_OAMethod @jResp, 'StringOf', @recording_type OUT, 'meetings[i].recording_files[j].recording_type'
            SELECT @j = @j + 1
          END
        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 "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-d "mc=false"
	-d "trash=false"
	-d "from=1989-05-07"
	-d "to=1989-05-07"
	-d "trash_type=meeting_recordings"
	-d "meeting_id=68423085"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/users/:userId/recordings

Postman Collection Item JSON

{
  "name": "List all recordings",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/users/:userId/recordings?page_size=30&next_page_token=quis officia in reprehenderit&mc=false&trash=false&from=1989-05-07&to=1989-05-07&trash_type=meeting_recordings&meeting_id=68423085",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users",
        ":userId",
        "recordings"
      ],
      "query": [
        {
          "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": "mc",
          "value": "false",
          "description": "Query Metadata of Recording if an On-Premise Meeting Connector was used for the meeting."
        },
        {
          "key": "trash",
          "value": "false",
          "description": "Query trash.\n`true`: List recordings from trash.<br> `false`: Do not list recordings from the trash.<br> The default value is `false`. If you set it to `true`, you can use the `trash_type` property to indicate the type of Cloud recording that you need to retrieve. "
        },
        {
          "key": "from",
          "value": "1989-05-07",
          "description": "The start date in 'yyyy-mm-dd' UTC format for the date range for which you would like to retrieve recordings. The maximum range can be a month. If no value is provided for this field, the default will be current date. For example, if you make the API request on June 30, 2020, without providing the “from” and “to” parameters, by default the value of 'from' field will be “2020-06-30” and the value of the 'to' field will be “2020-07-01”. \n\n**Note**: The \"trash\" files cannot be filtered by date range and thus, the \"from\" and \"to\" fields should not be used for trash files."
        },
        {
          "key": "to",
          "value": "1989-05-07",
          "description": "End date in 'yyyy-mm-dd' 'yyyy-mm-dd' UTC format. "
        },
        {
          "key": "trash_type",
          "value": "meeting_recordings",
          "description": "The type of Cloud recording that you would like to retrieve from the trash. The value can be one of the following:<br>\n    `meeting_recordings`: List all meeting recordings from the trash.<br>\n    `recording_file`: List all individual recording files from the trash. "
        },
        {
          "key": "meeting_id",
          "value": "68423085",
          "description": "The meeting ID."
        }
      ],
      "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 [cloud recordings](https://support.zoom.us/hc/en-us/articles/203741855-Cloud-Recording) of a user. 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\n<p style=\"background-color:#e1f5fe; color:#01579b; padding:8px\"> <b>Note:</b> To access a user's password protected cloud recording, add an <code>access_token</code> parameter to the download URL and provide either the <a href=\"https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-jwt-app\">JWT</a> or the user's OAuth access token as the value of the <code>access_token</code> parameter.</p>\n\nWhen a user records a meeting or a webinar by choosing the **Record to the Cloud** option, the video, audio, and chat text are recorded in the Zoom cloud.\n\n**Scopes:** `recording:read:admin`, `recording:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`\n\n**Prerequisites:** \n* Pro or a higher plan.\n* Cloud Recording must be enabled on the user's account."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nList of recording objects returned.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId/recordings?page_size=30&next_page_token=quis officia in reprehenderit&mc=false&trash=false&from=1989-05-07&to=1989-05-07&trash_type=meeting_recordings&meeting_id=68423085",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "recordings"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "mc",
              "value": "false"
            },
            {
              "key": "trash",
              "value": "false"
            },
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            },
            {
              "key": "trash_type",
              "value": "meeting_recordings"
            },
            {
              "key": "meeting_id",
              "value": "68423085"
            }
          ],
          "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 \"from\": \"2019-08-15\",\n \"to\": \"2019-09-15\",\n \"page_count\": 1,\n \"page_size\": 30,\n \"total_records\": 1,\n \"next_page_token\": \"\",\n \"meetings\": [\n  {\n   \"uuid\": \"gkABCDEnCkPuA==\",\n   \"id\": 1000000000000,\n   \"account_id\": \"AbcjxkfhdEEE\",\n   \"host_id\": \"z8dfkgABBBBBBBfp8uQ\",\n   \"topic\": \"MyTestPollMeeting\",\n   \"type\": 2,\n   \"start_time\": \"2019-08-29T21:54:49Z\",\n   \"timezone\": \"America/Los_Angeles\",\n   \"duration\": 1,\n   \"total_size\": 47383,\n   \"recording_count\": 1,\n   \"share_url\": \"https://api.zoom.us/recording/share/IABCDJDKDJEEEEEk_GwfdggdgkTziMw\",\n   \"recording_files\": [\n    {\n     \"id\": \"589ABBBBB-8718e\",\n     \"meeting_id\": \"gkABCDEnCkPuA==\",\n     \"recording_start\": \"2019-08-29T21:54:55Z\",\n     \"recording_end\": \"2019-08-29T21:55:24Z\",\n     \"file_type\": \"M4A\",\n     \"file_size\": 10098,\n     \"play_url\": \"https://api.zoom.us/recording/play/pfA2AvvvvvAnAzOibbbbELxl\",\n     \"download_url\": \"https://api.zoom.us/recording/download/pfA2AvvvvvAnAzOibbbbELxl\",\n     \"status\": \"completed\",\n     \"recording_type\": \"audio_only\"\n    },\n    {\n     \"meeting_id\": \"gkABCDEnCkPuA==\",\n     \"recording_start\": \"2019-08-29T21:54:55Z\",\n     \"recording_end\": \"2019-08-29T21:55:24Z\",\n     \"file_type\": \"TIMELINE\",\n     \"download_url\": \"https://api.zoom.us/recording/download/cc33ekldfdjfhf3-aaaaa\"\n    },\n    {\n     \"id\": \"96119b=kdfhf791\",\n     \"meeting_id\": \"gkABCDEnCkPuA==\",\n     \"recording_start\": \"2019-08-29T21:54:55Z\",\n     \"recording_end\": \"2019-08-29T21:55:24Z\",\n     \"file_type\": \"MP4\",\n     \"file_size\": 37285,\n     \"play_url\": \"https://api.zoom.us/recording/play/abcdkjfhdhfdhfj\",\n     \"download_url\": \"https://api.zoom.us/recording/download/abcdkjfhdhfdhfj\",\n     \"status\": \"completed\",\n     \"recording_type\": \"shared_screen_with_speaker_view\"\n    }\n   ]\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.\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/users/:userId/recordings?page_size=30&next_page_token=quis officia in reprehenderit&mc=false&trash=false&from=1989-05-07&to=1989-05-07&trash_type=meeting_recordings&meeting_id=68423085",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "recordings"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "mc",
              "value": "false"
            },
            {
              "key": "trash",
              "value": "false"
            },
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            },
            {
              "key": "trash_type",
              "value": "meeting_recordings"
            },
            {
              "key": "meeting_id",
              "value": "68423085"
            }
          ],
          "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": ""
    }
  ]
}