cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
614
Views
5
Helpful
4
Replies

Issue with Token Validation

AliceSilva
Level 1
Level 1

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.

 

1 Accepted Solution

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

View solution in original post

4 Replies 4

AliceSilva
Level 1
Level 1

I have created a .env file to keep the access token safe, and referenced it in another file with a variable and all

 Anotação 2022-06-22 120122.pngAnotação 2022-06-22 120303.png

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...

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).

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

Jeff Marshall
Cisco Employee
Cisco Employee

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?