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

how to debug betfair.exceptions.BetfairAPIError: INVALID_APP_KEY #15

Closed
ghost opened this issue Dec 24, 2014 · 1 comment
Closed

how to debug betfair.exceptions.BetfairAPIError: INVALID_APP_KEY #15

ghost opened this issue Dec 24, 2014 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 24, 2014

Firt of al, thanks alot for the great wrapper!

When I execute the code from the readme,

from betfair import Betfair
client = Betfair('test', 'certs/betfair.pem')
client.login('username', 'password')

from betfair.models import MarketFilter
event_types = client.list_event_types(
    MarketFilter(text_query='tennis')
)

I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 2, in list_event_types
  File "betfair/utils.py", line 125, in requires_login
    return func(*args, **kwargs)
  File "betfair/betfair.py", line 125, in list_event_types
    model=models.EventTypeResult,
  File "betfair/betfair.py", line 62, in make_api_request
    result = utils.result_or_error(response)
  File "betfair/utils.py", line 67, in result_or_error
    raise exceptions.BetfairAPIError(response, data)
betfair.exceptions.BetfairAPIError: INVALID_APP_KEY

The invalid app key error is not mentioned on the developers help site here:
https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Non-Interactive+%28bot%29+login

So I guess the reason is somewhere on the plugin side?

@ghost
Copy link
Author

ghost commented Dec 24, 2014

this was the solution.
https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Application+Keys

so instead of

client = Betfair('test', 'certs/betfair.pem')
client = Betfair('my_generated_app_key', 'certs/betfair.pem')

should have been called

@ghost ghost closed this as completed Dec 24, 2014
This issue was closed.
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

0 participants