Clicky

  • Welcome to P2P Lending / NFT Lending Forum.
 

ETH.LOAN

News:

This was the original Lend Academy peer-to-peer lending forum, since forensically restored by deBanked and now reintroduced to eth.loan.

To restore access to your user account, email [email protected]. We apologize for errors you may experience during the recovery.

Main Menu
NEW LOANS:   | remoraid.eth 0.299 Ξ | pineco.eth 0.299 Ξ | seaking.eth 1.500 Ξ | ALL

Buy notes on the secondary market with API get UnAuthorized error

Started by Peter, November 27, 2018, 11:00:00 PM

Previous topic - Next topic

dx2018

I tried REST api to buy note, but always fails with UnAuthorized error. Is there any additional steps I need to go through before using any secondary market API?

Here is what I did:

request ------------------------

POST https://api.lendingclub.com/api/investor/v1/accounts/" class="bbc_link" target="_blank">https://api.lendingclub.com/api/investor/v1/accounts/[myid]/trades/buy/ HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0
Authorization: [mytoken]
Content-Type: application/json
Accept: application/json
Host: api.lendingclub.com
Content-Length: 139
Expect: 100-continue

{
    "aid":[myid], "notes":
    [
        {"loanId":130087470, "orderId":204339626, "noteId":180152509, "bidPrice":0.01}
    ]
}

response -------------------------

HTTP/1.1 401 Unauthorized
Content-Type: application/json
Content-Length: 67
Date: Wed, 28 Nov 2018 21:40:31 GMT
Set-Cookie: XXXXX
Vary: Accept-Encoding

{"errors":[{"code":"unauthorized","msg":"Operation not allowed."}]}

I also try to include X-LC-Application-Key, but it doesn't help

request --------------------------

POST https://api.lendingclub.com/api/investor/v1/accounts/" class="bbc_link" target="_blank">https://api.lendingclub.com/api/investor/v1/accounts/[myid]/trades/buy/ HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0
Authorization: [mytoken]
X-LC-Application-Key: [myid]
Content-Type: application/json
Accept: application/json
Host: api.lendingclub.com
Content-Length: 139
Expect: 100-continue

{
    "aid":[myid], "notes":
    [
        {"loanId":130087470, "orderId":204339626, "noteId":180152509, "bidPrice":0.01}
    ]
}

response -------------------------

HTTP/1.1 401 Unauthorized
Content-Type: application/json
Content-Length: 67
Date: Wed, 28 Nov 2018 21:40:31 GMT
Set-Cookie: XXXXX
Vary: Accept-Encoding

{"errors":[{"code":"unauthorized","msg":"Operation not allowed."}]}

I also tried to access LC directly with the token, it works

request: ------------------------

GET https://api.lendingclub.com/api/investor/v1/accounts/" class="bbc_link" target="_blank">https://api.lendingclub.com/api/investor/v1/accounts/[myid]/availablecash/ HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Authorization: [mytoken]
X-LC-Application-Key: [myid]
Content-Type: application/json
Accept: application/json
Host: api.lendingclub.com
Accept-Encoding: gzip
Connection: Keep-Alive

response: ----------------------

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 47
Date: Wed, 28 Nov 2018 21:47:02 GMT

{"investorId":[myid],"availableCash":[mycash]}



liquidp2p_dev

Hi dx2018,

In order to use the secondary market API you need to request secondary market API access in addition to regular secondary market access.

The company that I work for, Liquid P2P, has quick instructions on how to sign up for secondary market API access here:

https://www.liquidp2p.com/getting-started#faq9" class="bbc_link" target="_blank">https://www.liquidp2p.com/getting-started#faq9

Hope this helps.

TravelingPennies

Thanks a lot liquidp2p_dev,

This's the exact inform I am looking. It solved my issue. Btw, your instruction page is a bit old, my case is auto approved.

Thanks Again

TravelingPennies


NEW LOANS:   | remoraid.eth 0.299 Ξ | pineco.eth 0.299 Ξ | seaking.eth 1.500 Ξ | ALL