Account does not enabled REST API

I successfully get token and then make a GET call for a users list. with a token supplied by sucessful oauth token request

def get_user_list(url, authorization_header, status=‘active’, page_size=‘30’):
post_data = {
‘status’:status,
‘page_size’:page_size
}
response = requests.get(
url=url,
headers=authorization_header,
params=post_data
)

However I get a response saying Account does not enabled REST API. I do not see such setting in the account settings.

authorization_header = ‘Authorization’: ‘Bearer ey******’
url = ‘https://api.zoom.us/v2/users

response =

reason: ‘Bad Request’
request: <PreparedRequest [GET]>
status_code: 400
text: ‘{“code”:200,“message”:“Account does not enabled REST API.”}’
url: ‘https://api.zoom.us/v2/users?status=active&page_size=30

any idea on the cause of this.

@jason.bowsher Hope you will be fine.

What type of account is used while authorizing with OAuth?

We get the access token with the following code. (No proxies used). The client ID/Secret and AccountID are the variable values generated in the zoom server to server oauth app registration credentials

def get_access_token(url, client_id, client_secret, account_id, proxy=PROXIES):
response = requests.post(
url,
data={“grant_type”: “client_credentials”, “account_id”:account_id},
auth=(client_id, client_secret),
# proxies=proxy
)
#return response.json()[“access_token”]
return response

I am also got error “Account does not enabled REST API” trying to create meeting via OAuth app in our Pro (Named Host) account.

POST:
https://api.zoom.us/v2/users/[USER_ID_HERE]/meetings

Response:
data: { code: 200, message: ‘Account does not enabled REST API.’ }

Can’t find where is i need to enable this API.

@hellomusic.ru

:point_right: USER_ID_HERE that user is created from API or Account Management?

Actually i tried different variants. Regarding documentation
https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/meetingCreate
“userId – the user ID or email address of the user”
We got only one user on our Pro account, so i tried pass email and account number from /profile page (i want just create meeting in this account)

Nothing works.

In case you mean what type of Zoom account reather than the server to server marketplace app generated account id. The Zoom account is a Business account

Hi @jason.bowsher , @hellomusic.ru could you please message me your account ids and confirm what type of licensing you have for your accounts? Thanks!

Found a resolution for this issue. the zoom_api_helper installed via pip works. I think it may be that you need to use the token in the same request session rather than passing it to a newly created session. Would be useful to confirm if this was the issue.

Interesting, thanks for sharing!

By session, do you mean a new separate request? Your access token should work as long as it’s unexpired. This behavior is unexpected.

By session I mean a request.session and in this same instance do the get token and then get function as the token is set in the session.

You can download the zoom_api_helper code from pypi and see this.

Thanks for sharing. I have not tested this helper yet so I appreciate you including your experience here for our developer community.