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

API not working anymore? [Unauthenticated calls work now, but not auth] #7

Open
tingofurro opened this issue Jul 3, 2023 · 5 comments

Comments

@tingofurro
Copy link

Haven't changed anything, but recently not able to log in anymore.

When posting to https://api.whatnot.com/api/login I am now getting [400 Bad Request], even though I've verified the email/pwd multiple times.

Anybody else seeing this?

@wxllow
Copy link
Owner

wxllow commented Jul 3, 2023 via email

@tingofurro
Copy link
Author

Sorry for the late reply, I was able to debug a bit more and have come to this minimal code:

import requests
device_id = "aea87c97-aaba-4426-ae44-d3db92e188d9"
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"

url = "https://api.whatnot.com/api/login"

response = requests.post(url, json={"username": username, "password": password, "device_id": device_id}, headers={"User-Agent": user_agent})
print(response.status_code)
print(response.json())

Which prints:

400
{'msg': 'Please upgrade your app to the latest version'}

I was also able to manually obtain the access token (by looking in the browser), and when I try to run usual commands, I get:

404, message='Not Found', url=URL('https://api.whatnot.com/graphql')

Is it possible they modified their API? Does the current library still work for you or others?

Thanks, I hope I can figure it out, it's been super useful.

@wxllow
Copy link
Owner

wxllow commented Jul 10, 2023

They modified their API to require some additional headers as well as adding an extra slash after the URL... but i fixed it in latest commit :) #f6ef128

Still haven't fixed the login yet but i'm working on it rn :)

@wxllow wxllow changed the title API not working anymore? API not working anymore? [Unauthenticated calls work now, but not auth] Jul 30, 2023
@tingofurro
Copy link
Author

Hey @wxllow , I appreciate your help.
I saw that you worked on the project recently, but commented the logging in part.
Is there a way to log in non-programmatically: logging in on the browser, and somehow saving the session and using it in the app?

I appreciate that you might not have time to work on this, so no worries. I'd be happy to help, but I am unsure on a how to "reverse engineer" their API and its requirements...

@wxllow
Copy link
Owner

wxllow commented Aug 12, 2023

What I do to reverse engineer their API is basically going on the website and using the Network tab in Chrome's developer tools to analyze the requests that the site makes to their APIs

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