mmohades / Venmo

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

request_money() 400 Bad Request Error 'User ID was not provided' #52

Closed bji219 closed 3 years ago

bji219 commented 3 years ago

Hi, cool API- I am having some trouble with the send and request_money() functions. I am inputing the requests as follows:

access_token = Client.get_access_token(username='my_username',
                                           password='my_password', device_id="blah")

venmo = Client(access_token=access_token)

venmo.payment.request_money(1.00, "message", "username")

However, I am getting the 404 error saying that the user ID was not provided. I checked and the ID is a valid Venmo username (like @username, where "username" would be input above).

The error:

 File "/Users/blahblahpath/python3.8/site-packages/venmo_api/utils/api_client.py", line 170, in __validate_response
    raise HttpCodeError(response=response)
venmo_api.models.exception.HttpCodeError: HTTP Status code is invalid. Could not make the request because -> 400 Bad Request.
Error: {'error': {'message': 'User ID was not provided. ', 'code': 1129, 'links': None, 'title': 'Error'}}

Please let me know if there is something I am missing here! Thanks again for sharing!

bji219 commented 3 years ago

Never mind, I used the user.id function that was mentioned in a previous comment to get the numeric id instead of the text. Using the numeric ID rather than the user handle works. Thanks!