JosephMcEvoy/PSZoom

Getting Unauthorized error when using Get-ZoomAccountRecordings

Closed this issue · 1 comments

Using PSZoom 2.0.2.0 on Win10 with PowerShell v5.1 nor v7.3.3

I can successfully authenticate and run commands like Get-ZoomUser and Get-ZoomRecordings, and retreive valid responses. However, I cannot run Get-ZoomAccountRecordings.

I have all the user and recording scopes enabled for my Zoom Server to Server OAuth app. Does this command use a different scope? Or is there an error somehow in how it is being called?

Using PS 7.3.3 I get the following error:

PS C:\Users\mpenner> Get-ZoomAccountRecordings -AccountId $AccountId -From '2021-06-01' -To '2021-06-30'
Invoke-ZoomRestMethod: C:\Program Files\WindowsPowerShell\Modules\PSZoom\2.0.2.0\Public\CloudRecording\Get-ZoomAccountRecordings.ps1:123:21
Line |
 123 |  … $response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $RequestBod …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Response status code does not indicate success: 401 (Unauthorized). Invalid access token.

Using PS 5.1 I get the following error:

> Get-ZoomAccountRecordings -AccountId $AccountId -From '2021-06-01' -To '2021-06-30'
Invoke-ZoomRestMethod : The remote server returned an error: (401) Unauthorized. 
At C:\Program Files\WindowsPowerShell\Modules\PSZoom\2.0.2.0\Public\CloudRecording\Get-ZoomAccountRecordings.ps1:123 char:21
+ ... $response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $RequestBod ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : AuthenticationError: (https://api.zoo...1&to=2021-06-30:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : 401,Invoke-ZoomRestMethod

See https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/getaccountcloudrecording for required permissions.

A Pro or a higher paid plan with Cloud Recording option enabled.
Scopes: recording:read:admin or account:read:admin

If the scope recording:read:admin is used, the Account ID of the Account must be provided in the accountId path parameter to list recordings that belong to the Account. This scope only works for sub accounts.

To list recordings of a master account, the scope must be account:read:admin and the value of accountId should be me.