Cannot connect to Zoom using PSZoom in powershell

I created Server-to-ServerOauth. I granted a scope to access the zoom rooms. It provided me an accountid, client id and secret. I also noticed it created two different tokens called secret token and verification token
I ran the following

$AccountID = 'ABCDEFGHIJKLMNO'
$clientID = 'ABCDEFGHIJKLMNO'
$secret = 'ABCDEFGHIJKLMNO'
Connect-PSZoom -AccountID $AccountID -ClientID $clientID -ClientSecret $secret 

I wanted to run a simple get command (get-zoomuser -userid username)
I get the following error
Invoke-ZoomRestMethod : Cannot process argument transformation on parameter ‘Token’. Cannot convert the “System.Security.SecureString” value of type “System.String” to type “System.Security.SecureString”

I convert the token into a securestring and still getting an error. Anything I am missing here?

Hi @jgorbea ,

PSZoom is not officially supported by Zoom so please reach out to its creator:

I was able to connect by running the following script


$tokenResponse = Invoke-WebRequest -Uri "https://zoom.us/oauth/token" -Method POST -ContentType 'application/x-www-form-urlencoded' -Body @{
    grant_type='account_credentials'
    account_id=$AccountID
} -Headers @{
    Host='zoom.us'
    Authorization="Basic $clientidandsecretconvertedbase64"
}

if ($tokenResponse.StatusCode -eq 200) {

    $tokenData = ConvertFrom-Json $tokenResponse.Content
    $accessToken = $tokenData.access_token
    $listRoomsUrl = "$baseUrl/rooms"

    $headers = @{
        "Authorization" = "Bearer $accessToken"
    }

    # Send the GET request to list rooms
    $listRoomsResponse = Invoke-WebRequest -Uri $listRoomsUrl -Headers $headers -Method Get
$roomsData = ConvertFrom-Json $listRoomsResponse.Content
}``

Where is the url to access the health of each device. Example Health = critical , Issue = Zoom room is offline. I check here and i couldnt find anything https://developers.zoom.us/docs/zoom-rooms/apis/#tag/Zoom-Rooms

image
example of the data i am looking for

Hi @jgorbea ,

Thanks so much for sharing this with the developer community!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.