Raise KeyError(key) from None

Im sure I am doing something silly.
I am trying to test this with python - https://developer.genesys.cloud/api/tutorials/chat-email-routing/#language=python&step=0

// Get client credentials from environment variables
Created Client as per here - https://help.mypurecloud.com/articles/create-an-oauth-client/
const CLIENT_ID = process.env.['GENESYS_CLOUD_CLIENT_ID'];
const CLIENT_SECRET = process.env.['GENESYS_CLOUD_CLIENT_SECRET'];

const ORG_REGION = process.env.['ap_southeast_2']; // eg. us_east_1

// Use your own data here
const PROVIDER_NAME = ['Developer Center Tutorial'];
const QUEUE_ID = '636f5551-04d9-8795-9350-7125b9b55123'

I just keep getting
File "f:\lamda_function.py", line 20, in
CLIENT_ID = os.environ['xxxxxxxxxxxxxxxxxxx']
File "C:\Users\Test\AppData\Local\Programs\Python\Python39\lib\os.py", line 679, in getitem
raise KeyError(key) from None
KeyError: 'yyyyyyyyyyyyyyyyyy'

Hello,

You are likely not setting your environment variables properly.
The error you try to import an environment variable that does't exist (from Python standpoint).

This blog may give you some info about it (if you are running your script from Mac, Windows, ..).

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.