Check this dev guide getting started article. Copy the sample code and follow the instructions to setup your Python webhook.
Thanks for your advice. I have tried that and server part works fine. When I try to. Execute the. Webhub's part of the. Application. I get the following errors and. Check my user ID secrets and. JWT. I think I'm very close. To be done. If I can get this authentication part. Text. Please see the following errors
Exception has occurred: SystemExit
Unable to authenticate to platform. Check credentials.HTTP 400 { "error" : "unauthorized_client", "error_description" : "Unauthorized for this grant type", "errors" : [ { "errorCode" : "OAU-251", "message" : "Unauthorized for this grant type" } ] } (request details: Method: POST URL: https://platform.ringcentral.com/restapi/oauth/token Headers: {'Authorization': 'Basic WTRoQzZJUEZrcT...', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION', 'X-User-Agent': 'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION', 'Content-Length': '760'})
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://platform.ringcentral.com/restapi/oauth/token During handling of the above exception, another exception occurred: File "C:\Peak\webhook.py", line 72, in login platform.login( jwt=os.environ.get('RC_USER_JWT') ) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ringcentral.http.api_exception.ApiException: HTTP 400 { "error" : "unauthorized_client", "error_description" : "Unauthorized for this grant type", "errors" : [ { "errorCode" : "OAU-251", "message" : "Unauthorized for this grant type" } ] } (request details: Method: POST URL: https://platform.ringcentral.com/restapi/oauth/token Headers: {'Authorization': 'Basic WTRoQzZJUEZrcT...', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION', 'X-User-Agent': 'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION', 'Content-Length': '760'}) During handling of the above exception, another exception occurred: File "C:\Peak\webhook.py", line 76, in login sys.exit("Unable to authenticate to platform. Check credentials." + str(e)) ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Peak\webhook.py", line 78, in <module> login() ~~~~~^^ SystemExit: Unable to authenticate to platform. Check credentials.HTTP 400 { "error" : "unauthorized_client", "error_description" : "Unauthorized for this grant type", "errors" : [ { "errorCode" : "OAU-251", "message" : "Unauthorized for this grant type" } ] } (request details: Method: POST URL: https://platform.ringcentral.com/restapi/oauth/token Headers: {'Authorization': 'Basic WTRoQzZJUEZrcT...', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION', 'X-User-Agent': 'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION', 'Content-Length': '760'})
Do you use the RingCentral Python SDK? If you implement your own code to authenticate a user using the JWT, check this dev guide and set the request body accordingly.