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

stackexchange.core.StackExchangeError: 406 [access_token_compromised]: Access token sent over non-HTTPS request, it has been invalidated #50

Open
90abyss opened this issue Apr 4, 2016 · 1 comment

Comments

@90abyss
Copy link

90abyss commented Apr 4, 2016

I need the json to return "accepted_answer" as one of the fields, which requires me to send access_token when I call the StackExchange API. I'm getting this error:

stackexchange.core.StackExchangeError: 406 [access_token_compromised]: Access token sent over non-HTTPS request, it has been invalidated

This is how I'm trying to do it:

so = stackexchange.Site(stackexchange.StackOverflow, 'myappkey')
so.impose_throttling = True
so.throttle_stop = False
posts = so.recent_questions(pagesize=10, filter ='!-rN2FZQY', access_token = 'xxx')

How can I fix this?

@lucjon
Copy link
Owner

lucjon commented Apr 8, 2016

Hello,

Retrieving the accepted_answer field on its own shouldn't require an access token — indeed, the field is part of the default filter. A separate issue in the library led to it not being included on the question object, but I've fixed that in commit 715b77f. Bear in mind that the field isn't included on questions which don't have an accepted answer yet.

I've also switched the library to use HTTPS by default (commit 2222c2b), so any other calls that require an access token should now work. You may need to regenerate the one you were using in the above example, however.

Either way, if you update to the latest master, everything should work.

Thanks, and please let me know if that works for you now :)

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