Lend Academy Network Forum

Lending Club Discussion => Investors - LC => Topic started by: ernst20020530 on April 23, 2015, 05:00:00 PM

Title: Lending Club API questions.
Post by: ernst20020530 on April 23, 2015, 05:00:00 PM
I have really confused about the new API. I am new guy for python, then I tried following


 req = urllib2.Request('https://api.lendingclub.com/api/investor/v1/accounts/111111/summary')  #111111 is my account ID
    try: response = urllib2.urlopen(req)
    except urllib2.URLError as e:
        print e.reason

But the code always failed with error code  "Unauthorized ".

what's wrong with the code.
Title: Re: Lending Club API questions.
Post by: mo on April 25, 2015, 08:12:17 PM
I have really confused about the new API. I am new guy for python, then I tried following


 req = urllib2.Request('https://api.lendingclub.com/api/investor/v1/accounts/111111/summary')  #111111 is my account ID
    try: response = urllib2.urlopen(req)
    except urllib2.URLError as e:
        print e.reason

But the code always failed with error code  "Unauthorized ".

what's wrong with the code.

If that is all your code one problem is you aren't setting the authentication header.  That would explain the unauthorized error.

https://www.lendingclub.com/developers/authentication.action (https://www.lendingclub.com/developers/authentication.action)