Hi Zoom community!
So recently I’m writing scripts running from our windows server, and one of our scripts purpose is to delete ex-employees accounts. When I get to the point where I’m trying to connect our Zoom Admin console using Rest API, I keep getting the same error:
error
@{code=300; message=Api key and secret are required.}
And I’m 100% sure that my creds are written correctly without any mistakes because it works properly while using the same credentials on Bash.
In addition, I have tried all encoding methods (UTF8 , ASCII, Default…), I don’t think it is something related to the encoding method…
Here are the parameters I tested the connection with:
#==========================
$clientid = “xxx”
$key = “xxx”
$url = “https://api.zoom.us/v1/metrics/zoomrooms”
EncodedUsernamePassword = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((’{0}:{1}’ -f $clientid, $key)))
Headers = @{'Authorization' = "Basic ($EncodedUsernamePassword)"; ‘accept’ = ‘application/json’; ‘Content-type’ = ‘application/json’; ‘Accept-Encoding’ = ‘gzip, deflate’}
Invoke-RestMethod -Method Get -Uri $url -Headers $Headers
#==========================
Assist is very needed here!
Thanks ahead!