Hello!
I have been running into some issues with connecting to our account. I am going to post the code I am using to authenticate. I am running to the issue with code 2031 when I send a GET request to the endpoint: /accounts/{accountId}/phone/call_logs
Error I get back:
{‘code’: 2031, ‘message’: ‘Zoom Phone has not been enabled for this account.’}
However, I have gone through a bunch of steps that should solve this issue.
- We have a business/Enterprise Account
*We have the correct scopes to our Server-to-Server OAuth App
*We have paid in full balance on our account
*We have added the correct license onto our account owner and have made the OAuth app through that user.
CODE:
Auth Code:
import requests
import base64
import json
Zoom OAuth credentials
client_id = ‘client_id’
client_secret = ‘client_secret’
Encode your credentials
credentials = base64.b64encode(
f’{client_id}:{client_secret}'.encode(‘utf-8’)).decode(‘utf-8’)
Zoom’s OAuth token endpoint
url = ‘https://zoom.us/oauth/token?grant_type=client_credentials’
Set the headers
headers = {
“Content-Type”: “application/x-www-form-urlencoded”,
‘Authorization’: f’Basic {credentials}’
}
Make the POST request
response = requests.post(url, headers=headers)
access_token_full = response.json()
Get the access token from the response
access_token = response.json().get(‘access_token’)
GET Request Code:
Zoom’s Phone Call Logs API endpoint
accountId = ‘account_id’
url = f’https://api.zoom.us/v2/accounts/{accountId}/phone/call_logs’
print(url)
Set the headers
headers = {
‘Authorization’: f’Bearer {access_token}',
‘Content-Type’: ‘application/json’
}
params = {
‘from’: ‘2022-01-01’,
‘to’: ‘2022-01-31’,
‘page_size’: 300,
‘type’: ‘all’
}
Make the GET request
response = requests.get(url, headers=headers, params=params)
Print the response
print(response.json())
Message that gets printed:
{‘code’: 2031, ‘message’: ‘Zoom Phone has not been enabled for this account.’}
Any help around this would be great. I have went through both the Master API and regular API and I am getting the same results.