Skip to main content

Author Topic: Buy notes on the secondary market with API

h
  • Posts: 26
Buy notes on the secondary market with API
OP: November 26, 2017, 12:00:00 AM
Hi
If I try to buy a NOTE from the SECONDARY market using the PHP script below, I get "Internal Server Error 1510609349610".

I know that My ID and API Key are correct, because I can use them and successfully get the balance and  Notes I currently own, using the same script.
For example here is a note I was trying to buy: https://www.lendingclub.com/foliofn/browseNotesLoanPerf.action?showfoliofn=true&loan_id=80600463&order_id=117950693&note_id=130430010

Any ideas. Please help
Thanks

Code: [Select]
  • IP logged

T
  • Posts: 6588
Buy notes on the secondary market with API
#1: December 09, 2017, 12:00:00 AM
Hi,  Can anyone please help?
  • IP logged

  • *****
  • Hero Member
  • Posts: 608
Buy notes on the secondary market with API
#2: December 10, 2017, 12:00:00 AM
Any time you get a "server error", I would ask LC.  That means something went wrong inside their server, likely something unusual you did that was not checked at the right spot to give you a decent error message.
  • IP logged

  • Posts: 300
Buy notes on the secondary market with API
#3: December 10, 2017, 12:00:00 AM
Have you been able to successfully make simple Folio API buy call first? The best practice for using API calls is to first make the simplest API call, capture the received errors and responses and then incorporate rest of the logic. Have you captured the complete response received from your curl API buy call? Have you inserted debugging statements to see where your program craps out?
  • IP logged

R
  • Posts: 484
Buy notes on the secondary market with API
#4: December 10, 2017, 12:00:00 AM
You might try to talk to the API using the program SoapUI first. It's an excellent tool.
An open source free download is at: https://www.soapui.org/

Here's an example of a Folio API sell in C using libcurl. If I remember (its been a while), the transfer and accept encoding setopts are very important. Probably why I commented those lines. I doubt its changed but this code hasn't been run in over a year. No guarantees, use this code at your own risk.

Code: [Select]
  • IP logged

T
  • Posts: 6588
Buy notes on the secondary market with API
#5: December 10, 2017, 12:00:00 AM
Thanks Anil, Fred.
I am able to get the OWNED NOTES and BALANCE with the script, so i believe the api call is correct
Only wen I execute the BUY part of the script, it gives the "Internal Server Error"
What would the syntax be for a "simple Folio API buy call"? Do you have any examples I can use.
I tried going over the LC docs too.
Unfortunately the script was written by someone else and is not longer available, so I am trying to get it to work.

Thanks
Hil
  • IP logged

a
  • Posts: 32
Buy notes on the secondary market with API
#6: December 10, 2017, 12:00:00 AM
You can try emailing LC directly, they've been pretty supportive in my experience.
  • IP logged

T
  • Posts: 6588
Buy notes on the secondary market with API
#7: December 22, 2017, 12:00:00 AM
After lots of back and forth with LC support they are now telling me that there is a different Key to buy Notes off the secondary market (other than the Api). They mention that, its the reason why my script (above) is not working. I do not find any key other than my API.
Is that true or are they just yanking my chain?
  • IP logged


T
  • Posts: 6588
Buy notes on the secondary market with API
#9: December 23, 2017, 12:00:00 AM
I thought so too. But here is the email I received from support
Quote
  • IP logged


T
  • Posts: 6588
Buy notes on the secondary market with API
#11: December 29, 2017, 12:00:00 AM
Thanks Fred for the details.

I modified the script with the authorization header and key and I still get the "Internal server error". 
I have debugged the code further and I see the error appears on line $server_output .

Code: [Select]
  • IP logged

T
  • Posts: 6588
Buy notes on the secondary market with API
#12: December 29, 2017, 12:00:00 AM
Quote
  • IP logged

T
  • Posts: 6588
Buy notes on the secondary market with API
#13: December 29, 2017, 12:00:00 AM
Thanks Fred. That did it!!!!
I finally got a "SUCCESS_PENDING_SETTLEMENT"
  • IP logged

T
  • Posts: 6588
Buy notes on the secondary market with API
#14: December 29, 2017, 12:00:00 AM
Now you get to learn the joys of "PENDING SETTLEMENT", and how many don't make it thru this step.
  • IP logged