RBasavaraju | 2022-08-23 15:40:00 UTC | #1
Has anyone able to get PureCloudPlatformClientV2 version 150.0.0 working on Python version 3.10 (Linux and Windows). Recently, I tried and unfortunately, I can’t get past authentication stage (TypeError: expected string or bytes-like object)! It feels like PureCloudPlatformClientV2 is not compatible with Python version 3.10. I am in the process testing it with Python 3.9.x but that’s bit involved on my side and that’s another story. Any pointes are be much appreciated.
anon11147534 | 2022-08-23 16:18:20 UTC | #2
Hi,
Can you share a copy of the code you are using? Redacting credentials of course.
I tried on OS X using python 3.10.6 and PureCloudPlatformClientV2 version 150.0.0 without issue.
RBasavaraju | 2022-08-23 16:40:11 UTC | #3
Here's the code snippet.
import PureCloudPlatformClientV2 from PureCloudPlatformClientV2.rest import ApiException
Innovation Lab API Keys
clientid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' clientsecret = 'xxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxx' orgregion = 'uswest_2'
try: region = PureCloudPlatformClientV2.PureCloudRegionHosts[orgregion] PureCloudPlatformClientV2.configuration.host = region.getapi_host
apiclient = PureCloudPlatformClientV2.apiclient.ApiClient().getclientcredentialstoken(clientid, clientsecret) authApi = PureCloudPlatformClientV2.AuthorizationApi(apiclient)
print(authApi.apiclient.accesstoken) except ApiException as e: print(e)
RBasavaraju | 2022-08-23 16:41:57 UTC | #4
tim.smith | 2022-09-06 13:39:03 UTC | #5
RBasavaraju, post:3, topic:16000
region = PureCloudPlatformClientV2.PureCloudRegionHosts[orgregion] PureCloudPlatformClientV2.configuration.host = region.getapi_host
This code appears incorrect, the second line in particular where you're assigning the function itself instead of invoking it. Refer to the example here: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/#setting-the-environment
RBasavaraju | 2022-08-23 16:54:28 UTC | #6
Thanks Tim, I didn't realize till now my cut and paste did do the number on me!
system | 2022-09-23 16:55:02 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 16000