pynder icon indicating copy to clipboard operation
pynder copied to clipboard

401 on session.matches() request

Open dongle opened this issue 7 years ago • 12 comments

Simple code for repro: session = pynder.Session(FBTOKEN) matches = session.matches() for match in matches[:5]: print match

Result: File "pyntest.py", line 11, in <module> matches = session.matches() File "/Users/archer/Downloads/pynder/pynder/session.py", line 41, in matches response = self._api.matches(since) File "/Users/archer/Downloads/pynder/pynder/api.py", line 65, in matches return self.updates(since)['matches'] File "/Users/archer/Downloads/pynder/pynder/api.py", line 56, in updates return self._post("/updates", {"last_activity_date": since} if since else {}) File "/Users/archer/Downloads/pynder/pynder/api.py", line 50, in _post return self._request("post", url, data=data) File "/Users/archer/Downloads/pynder/pynder/api.py", line 41, in _request raise errors.RequestError(result.status_code) pynder.errors.RequestError: 401

I can successfully get nearby users, etc, so the auth seems to be working.

Thx & let me know how I can help!

dongle avatar Dec 31 '16 00:12 dongle

I am also experiencing this.

ghost avatar Apr 09 '17 00:04 ghost

/updates needs to be a GET request and not a POST one, in my own version I experienced the same issue if you use the wrong type of request on an API endpoint.

DylanVanAssche avatar Apr 09 '17 05:04 DylanVanAssche

`FBID = "YOUR_FB_ID" FBTOKEN= "YOUR_FB_TOKEN"

session = pynder.Session(facebook_id=BID, facebook_token=FBTOKEN)`

Seems to happen you use positional arguments in the session object instead of keyword arguments.

avbanks avatar Apr 16 '17 02:04 avbanks

I am having this problem as well. Can someone explain the syntax difference between a GET and POST request in the scope of this git project?

This help file I read helped clear things up a lot but not relative to this project http://www.geeksforgeeks.org/get-post-requests-using-python/

brenly avatar Jun 22 '17 20:06 brenly

Post your code... Or read my comment above.

avbanks avatar Jun 24 '17 16:06 avbanks

https://github.com/brenly/pynderscripting/blob/master/session_start.py

brenly avatar Jun 27 '17 22:06 brenly

I am going to be trying out other peoples code and will post any developments if I resolve my own issue.

brenly avatar Jun 27 '17 22:06 brenly

session = pynder.Session(auth_info[0], fb_access_token)

The arguments for this object are keyword

Use something like session = pynder.Session(facebook_id=BID, facebook_token=FBTOKEN)

avbanks avatar Jun 28 '17 02:06 avbanks

Just wanted to get back to this thread. The advice from @avbanks was helpful and worked! It got me past the 401 error. Thank you!

my working code as below: #(auth_info[] is pulled from auth.info file) FBTOKEN = (get_access_token(email=auth_info[1], password=auth_info[2])) session = pynder.Session(facebook_id=auth_info[0], facebook_token=FBTOKEN)

brenly avatar Aug 05 '17 21:08 brenly

Until yesterday it worked fine with the solution from @avbanks. Today I get the 401 error again.

FB_ID = ""
FB_TOKEN = ""
session = pynder.Session(facebook_id=FB_ID, facebook_token=FB_TOKEN)

Authentification is successful, does anyone have an idea what might be the issue?

EDIT: I opened Tinder on my phone and after that everything was fine again. I don't understand it, but perhaps it helps if someone has the same issue.

PaulAhuevo avatar Aug 19 '17 10:08 PaulAhuevo

deleted "config.FACEBOOK_ID" from session = pynder.Session(config.FACEBOOK_AUTH_TOKEN) seems to work fine

olesgedz avatar Aug 25 '17 13:08 olesgedz

deleted "config.FACEBOOK_ID" from session = pynder.Session(config.FACEBOOK_AUTH_TOKEN) seems to work fine

What exactly did you do? Sorry if this is a dumb question.

mjs966 avatar Aug 26 '17 21:08 mjs966