Chilkat Online Tools

PowerBuilder / Zoom API / List account's archived files

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Uuid
integer li_Id
string ls_Host_id
string ls_Topic
integer li_V_type
string ls_Start_time
string ls_Timezone
integer li_Duration
integer li_Total_size
integer li_Recording_count
string ls_Meeting_type
string ls_Account_name
string ls_Complete_time
integer li_Is_breakout_room
integer j
integer li_Count_j
string ls_Id_str
string ls_File_type
string ls_File_extension
integer li_File_size
string ls_Download_url
string ls_Status
string ls_Recording_type
integer li_Individual
string ls_Participant_email
string ls_Participant_join_time
string ls_Participant_leave_time
string ls_From
string ls_V_to
integer li_Page_size
string ls_Next_page_token
integer i
integer li_Count_i

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")

loo_QueryParams.UpdateInt("page_size",30)
loo_QueryParams.UpdateString("next_page_token","quis officia in reprehenderit")
loo_QueryParams.UpdateString("from","quis officia in reprehenderit")
loo_QueryParams.UpdateString("to","quis officia in reprehenderit")
loo_QueryParams.UpdateString("query_date_type","meeting_start_time")

// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"

loo_Resp = loo_Http.QuickRequestParams("GET","https://api.zoom.us/v2/accounts/:accountId/archive_files",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_QueryParams
    return
end if

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_QueryParams
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp

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

// {
//   "from": "2021-03-11T05:41:36Z",
//   "to": "2021-03-18T05:41:36Z",
//   "page_size": 30,
//   "next_page_token": "",
//   "meetings": [
//     {
//       "uuid": "yO3dfhh3t467UkQ==",
//       "id": 553068284,
//       "host_id": "Dhjdfgdkg8w",
//       "topic": "Zoom Meeting",
//       "type": 1,
//       "start_time": "2021-03-12T01:57:27Z",
//       "timezone": "",
//       "duration": 3,
//       "total_size": 364463,
//       "recording_count": 2,
//       "meeting_type": "internal",
//       "account_name": "account_01",
//       "complete_time": "2021-03-12T02:57:27Z",
//       "is_breakout_room": false,
//       "archive_files": [
//         {
//           "id": "55hfgsd-sd8e2bd7255",
//           "file_type": "M4A",
//           "file_extension": "M4A",
//           "file_size": 165743,
//           "download_url": "https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngBBBB",
//           "status": "completed",
//           "recording_type": "audio_only",
//           "individual": true,
//           "participant_email": "user@example.com",
//           "participant_join_time": "2021-03-12T02:07:27Z",
//           "participant_leave_time": "2021-03-12T02:12:27Z"
//         },
//         {
//           "id": "9c5daa5b-34a1-40e8-8947-a11be5e373a7",
//           "file_type": "MP4",
//           "file_extension": "MP4",
//           "file_size": 198720,
//           "download_url": "https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngCCCC",
//           "status": "completed",
//           "recording_type": "shared_screen_with_speaker_view",
//           "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

ls_From = loo_JResp.StringOf("from")
ls_V_to = loo_JResp.StringOf("to")
li_Page_size = loo_JResp.IntOf("page_size")
ls_Next_page_token = loo_JResp.StringOf("next_page_token")
i = 0
li_Count_i = loo_JResp.SizeOfArray("meetings")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Uuid = loo_JResp.StringOf("meetings[i].uuid")
    li_Id = loo_JResp.IntOf("meetings[i].id")
    ls_Host_id = loo_JResp.StringOf("meetings[i].host_id")
    ls_Topic = loo_JResp.StringOf("meetings[i].topic")
    li_V_type = loo_JResp.IntOf("meetings[i].type")
    ls_Start_time = loo_JResp.StringOf("meetings[i].start_time")
    ls_Timezone = loo_JResp.StringOf("meetings[i].timezone")
    li_Duration = loo_JResp.IntOf("meetings[i].duration")
    li_Total_size = loo_JResp.IntOf("meetings[i].total_size")
    li_Recording_count = loo_JResp.IntOf("meetings[i].recording_count")
    ls_Meeting_type = loo_JResp.StringOf("meetings[i].meeting_type")
    ls_Account_name = loo_JResp.StringOf("meetings[i].account_name")
    ls_Complete_time = loo_JResp.StringOf("meetings[i].complete_time")
    li_Is_breakout_room = loo_JResp.BoolOf("meetings[i].is_breakout_room")
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("meetings[i].archive_files")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Id_str = loo_JResp.StringOf("meetings[i].archive_files[j].id")
        ls_File_type = loo_JResp.StringOf("meetings[i].archive_files[j].file_type")
        ls_File_extension = loo_JResp.StringOf("meetings[i].archive_files[j].file_extension")
        li_File_size = loo_JResp.IntOf("meetings[i].archive_files[j].file_size")
        ls_Download_url = loo_JResp.StringOf("meetings[i].archive_files[j].download_url")
        ls_Status = loo_JResp.StringOf("meetings[i].archive_files[j].status")
        ls_Recording_type = loo_JResp.StringOf("meetings[i].archive_files[j].recording_type")
        li_Individual = loo_JResp.BoolOf("meetings[i].archive_files[j].individual")
        ls_Participant_email = loo_JResp.StringOf("meetings[i].archive_files[j].participant_email")
        ls_Participant_join_time = loo_JResp.StringOf("meetings[i].archive_files[j].participant_join_time")
        ls_Participant_leave_time = loo_JResp.StringOf("meetings[i].archive_files[j].participant_leave_time")
        j = j + 1
    loop
    i = i + 1
loop


destroy loo_Http
destroy loo_QueryParams
destroy loo_SbResponseBody
destroy loo_JResp

Curl Command

curl -G -d "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-d "from=quis%20officia%20in%20reprehenderit"
	-d "to=quis%20officia%20in%20reprehenderit"
	-d "query_date_type=meeting_start_time"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/accounts/:accountId/archive_files

Postman Collection Item JSON

{
  "name": "List account's archived files",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/accounts/:accountId/archive_files?page_size=30&next_page_token=quis officia in reprehenderit&from=quis officia in reprehenderit&to=quis officia in reprehenderit&query_date_type=meeting_start_time",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "accounts",
        ":accountId",
        "archive_files"
      ],
      "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": "from",
          "value": "quis officia in reprehenderit",
          "description": "Start date for the query in \"yyyy-MM-dd'T'HH:mm:ss'Z'\" format. The duration for the query defined using the \"from\" and \"to\" parameters should not exceed 7 days as this API only provides a week's data at once."
        },
        {
          "key": "to",
          "value": "quis officia in reprehenderit",
          "description": "End date for the query in \"yyyy-MM-dd'T'HH:mm:ss'Z'\" format. "
        },
        {
          "key": "query_date_type",
          "value": "meeting_start_time",
          "description": "The query date type for the `from` and `to` parameters."
        }
      ],
      "variable": [
        {
          "key": "accountId"
        }
      ]
    },
    "description": "Use this API to retrieve archived meeting or webinar files of an account. \n\n Zoom’s [archiving solution](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data) allows account administrators to set up an automated mechanism to record, collect, and archive meeting data to a 3rd-party platform of their choice to satisfy FINRA and/or other compliance requirements. \n\n**Scopes:** `recording:read:admin` <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium` \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**\nArchived files returned.\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/archive_files?page_size=30&next_page_token=quis officia in reprehenderit&from=quis officia in reprehenderit&to=quis officia in reprehenderit&query_date_type=meeting_start_time",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "archive_files"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "from",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "to",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "query_date_type",
              "value": "meeting_start_time"
            }
          ],
          "variable": [
            {
              "key": "accountId"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"from\": \"2021-03-11T05:41:36Z\",\n \"to\": \"2021-03-18T05:41:36Z\",\n \"page_size\": 30,\n \"next_page_token\": \"\",\n \"meetings\": [\n  {\n   \"uuid\": \"yO3dfhh3t467UkQ==\",\n   \"id\": 553068284,\n   \"host_id\": \"Dhjdfgdkg8w\",\n   \"topic\": \"Zoom Meeting\",\n   \"type\": 1,\n   \"start_time\": \"2021-03-12T01:57:27Z\",\n   \"timezone\": \"\",\n   \"duration\": 3,\n   \"total_size\": 364463,\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\": \"55hfgsd-sd8e2bd7255\",\n     \"file_type\": \"M4A\",\n     \"file_extension\": \"M4A\",\n     \"file_size\": 165743,\n     \"download_url\": \"https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngBBBB\",\n     \"status\": \"completed\",\n     \"recording_type\": \"audio_only\",\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\": \"9c5daa5b-34a1-40e8-8947-a11be5e373a7\",\n     \"file_type\": \"MP4\",\n     \"file_extension\": \"MP4\",\n     \"file_size\": 198720,\n     \"download_url\": \"https://example.com/recording/download/Qg75t7xZBtEbAkjdlgbfdngCCCC\",\n     \"status\": \"completed\",\n     \"recording_type\": \"shared_screen_with_speaker_view\",\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  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad request**<br>\n**Error Code:** `2001`<br>\nAccount does not exist: {accountId}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/archive_files?page_size=30&next_page_token=quis officia in reprehenderit&from=quis officia in reprehenderit&to=quis officia in reprehenderit&query_date_type=meeting_start_time",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "archive_files"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "from",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "to",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "query_date_type",
              "value": "meeting_start_time"
            }
          ],
          "variable": [
            {
              "key": "accountId"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}