06-22-2022 07:20 AM
I'm having a problem activating the bot using powershell, it seems that it is not validating the token, can anyone help me with this problem? I hav already created the bot properly and got the token but this error keeps appearing when I try to activate it
webexteamssdk.exceptions.AccessTokenError: You must provide a Webex Teams access token to interact with the Webex Teams APIs, either via a WEBEX_TEAMS_ACCESS_TOKEN environment variable or via the access_token argument.
Solved! Go to Solution.
06-22-2022 08:48 AM
AFAIK, just having a .env file around won't cause environment variables to be automatically loaded from it - you'll need to use python-dotenv to make that happen: https://pypi.org/project/python-dotenv/#getting-started
06-22-2022 08:05 AM
I have created a .env file to keep the access token safe, and referenced it in another file with a variable and all
And I have done the same process on another PC (with another key) and it worked just fine, I don't know why it's not working in this PC...
06-22-2022 08:28 AM
Since you're trying to read it from a .env file you could install the python-dotenv module and then import it that way. Seems like for whatever reason the python script isn't able to see/read the .env file with the way you're currently trying(you can try searching stackoverflow to see if someone has ran into that issue and a solution was provided).
06-22-2022 08:48 AM
AFAIK, just having a .env file around won't cause environment variables to be automatically loaded from it - you'll need to use python-dotenv to make that happen: https://pypi.org/project/python-dotenv/#getting-started
06-22-2022 07:56 AM - edited 06-22-2022 07:56 AM
Based on the error it seems like you're not providing the access token to the script properly. What exactly are you trying to do in order to provide the access token to the app?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide