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