Reputation: 20912
I am trying to use this Python code to access the Folio API for the secondary market listings. Similar code worked for me in the primary Lending Club listings. This returns an error code [500], an internal error.
import requests
lc_InvestorId = "1111"
lc_apikey = "xxxx"
lc_module = 'secondarymarket/listings'
url = f"https://api.lendingclub.com/api/investor/v1/{lc_module}"
payload = {}
params = {'updatedSince':10000}
headers = {
'ContentType': "application/json",
'Accept': "application/json",
'Authorization': lc_apikey,
'X-LC-Application-Key': lc_InvestorId
}
response = requests.request("GET", url, data=payload, headers=headers, params=params)
Upvotes: 0
Views: 120
Reputation: 20912
According to the Folio Note Trading API manual (1/22/2018):
Supported formats: CSV
For the Listings GET call, you must include the Accept: text/csv header and exclude the Content-Type header
Changing the headers to this worked:
headers = {
'Accept': "text/csv",
'Authorization': lc_apikey,
'X-LC-Application-Key': lc_InvestorId
}
Upvotes: 0