mmohades / Venmo

Venmo API client for Python
GNU General Public License v3.0
148 stars 45 forks source link

How do I set my device ID? #8

Closed xxCleef closed 4 years ago

xxCleef commented 4 years ago

I'm trying to avoid entering my 2FA code each time when logging in and saved the device ID which I used, how would I set that?

mmohades commented 4 years ago

Hey, sorry for the late reply. You don't have to login every time. Once you get your access token, that will never expire until you manually revoke the access token using venmo.log_out(access_token) function. Next time, you can just use your access token like this to continue using the wrapper:

from venmo_api import Client

venmo = Client(access_token='your access token that you have saved from before')

# Example, search for users:
users = venmo.user.search_for_users(query='Peter',
                                    page=2)

To answer your question, here is how you can login using the device ID that you have saved from your last login: get_access_token(username='myemail@random.com', password='your password', device_id='your device ID here')