Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to get auth token #205

Closed
charlotattard opened this issue Nov 20, 2023 · 4 comments
Closed

Error when trying to get auth token #205

charlotattard opened this issue Nov 20, 2023 · 4 comments

Comments

@charlotattard
Copy link

Hello,

Thanks a lot for providing us with this public repo.

I'm running python 3.11 and my intention is to get product id's and the end goal is serve this repo over a restful api mainly to get product info such as price. I'm getting the below error.

I'm running the below command

ikea_api.Auth(constants).get_guest_token()

and getting the below error

EndpointInfo(func=functools.partial(<function Auth.get_guest_token at 0x1046c6480>, <ikea_api.endpoints.auth.Auth object at 0x1063c33d0>), handlers=[<function handle_json_decode_error at 0x104467c40>, <function handle_401 at 0x1046c5300>, <function handle_not_success at 0x1046c6020>])

@vrslev
Copy link
Owner

vrslev commented Nov 21, 2023

Hi! You should use ikea_api.run() or ikea_api.run_async()

@vrslev
Copy link
Owner

vrslev commented Nov 21, 2023

More info in readme: https://github.com/vrslev/ikea-api-client#usage

@charlotattard
Copy link
Author

Hi! You should use ikea_api.run() or ikea_api.run_async()

Can you please elaborate a bit I’m new to Phyton. I didn’t quite understand your point I ran that command before trying to get the auth token. Thanks a lot

@vrslev
Copy link
Owner

vrslev commented Nov 21, 2023

Endpoints in library are abstract to allow user to choose whether they want to run code synchroniously or asynchronously (with asyncio).

This code will give you expected result: ikea_api.run(ikea_api.Auth(constants).get_guest_token())

@vrslev vrslev closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants