I'm attempting to pull data from a Sandbox Env - Call Log. There is confirmed one record on the Call Log, for context. I'm using a Sandbox App that uses JWT Auth. When I run 'python3 pray.py' in Terminal, I get the following error:
Unable to authenticate to platform. Check credentials.Unauthorized for this grant type
Here is the code I'm running:
from ringcentral import SDK
RINGCENTRAL_CLIENTID = 'hTTB9Rt9QT6ctmCyK9c2EA'
RINGCENTRAL_CLIENTSECRET = 'sP8##############################PG4Qg'
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com'
rcsdk = SDK( RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER)
platform = rcsdk.platform()
JWT_TOKEN = "eyJraWQiOiI########################################MjU2In0"
try:
platform.login( jwt=JWT_TOKEN )
params = {
'dateFrom': "2012-01-01T00:00:00.000Z"
}
resp = platform.get('/restapi/v1.0/account/~/extension/~/call-log', params)
for record in resp.json().records:
print ("Call type: " + record.type)
except Exception as e:
print ("Unable to authenticate to platform. Check credentials." + str(e))
I have given the Sandbox App every single permission available, including Read Call Log. My Python3 version is Python 3.8.9.
What could be causing this issue? I appreciate any help that can be provided. I scoured other similar questions on the forum, but I was unable to fix with those resolutions.