I’m having trouble attaining a bearer token for a server to server app. Following instructions provided by Zoom for the Server to Server OAuth entry.
I use the following, inserting my ClientID, ClientSecret and AccountId in the respective places.
in powershell:
$creds = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(‘CLIENT_ID:CLIENT_SECRET’))
Invoke-WebRequest -Method POST -Uri https://zoom.us/oauth/token -ContentType ‘application/x-www-form-urlencoded’ -Body @{ grant_type=‘account_credentials’; account_id=‘ACCOUNT_ID’ } -Headers @{ Host=‘zoom. us’; Authorization=“Basic $creds” }
When I tried this I receive a generic 400 error that doesn’t get logged to the app
I also took the output of the $creds variable and used it for the command prompt options, as shown below.
in Command Prompt
curl -X POST https://zoom.us/oauth/token -d ‘grant_type=account_credentials’ -d ‘account_id={accountID}’ -H ‘Host: zoom. us’ -H ‘Authorization: Basic Base64Encoded(clientId:clientSecret)’
in this case I receive a “Bad host name error”.
I’ve gone through the FAQ, as well as verified that my app is server-to-server and it is active. I’m not sure what is missing here and could use some help.
As a note I had to add a space in the zoom .us to avoid the link limitation.