diff --git a/fast_arrow/client.py b/fast_arrow/client.py index 79541b7..9b23795 100644 --- a/fast_arrow/client.py +++ b/fast_arrow/client.py @@ -1,4 +1,6 @@ import os +import uuid + import requests from fast_arrow.util import get_last_path from fast_arrow.resources.account import Account @@ -111,6 +113,7 @@ def login_oauth2(self, username, password, mfa_code=None): Login using username and password ''' data = { + "device_token": uuid.uuid4(), "grant_type": "password", "scope": "internal", "client_id": CLIENT_ID, diff --git a/fast_arrow/resources/option_position.py b/fast_arrow/resources/option_position.py index ff2ea46..b0f6852 100644 --- a/fast_arrow/resources/option_position.py +++ b/fast_arrow/resources/option_position.py @@ -14,9 +14,10 @@ def all(cls, client, **kwargs): max_date = kwargs['max_date'] if 'max_date' in kwargs else None max_fetches = \ kwargs['max_fetches'] if 'max_fetches' in kwargs else None + nonzero = kwargs.get('nonzero', False) url = 'https://api.robinhood.com/options/positions/' - params = {} + params = {'nonzero': nonzero} data = client.get(url, params=params) results = data["results"]