他のエンドポイントでもAPIリクエストを作成できましたが、購入のエンドポイントはまったく動作していないようです。彼らの最後にサーバーエラーがあるように思えますが、私が間違って間違っている場合に備えてここで質問します。LendingClub.com API 500セカンダリーマーケットのノートを購入する際のエラー
私は、関数の複数のバージョンを書かれているが、これは1です:
function getLCInfo($endpoint, $getData = false) {
$api_url = "https://api.lendingclub.com/api/investor/";
$verison = "v1";
$account_id = "12345678";
$ContentType = "application/json";
$url = "$api_url$verison/accounts/$account_id/$endpoint/";
if($getData) {
$url .= "?" . urldecode(http_build_query($getData));
echo $url;
}
$key = "aaaaaaaaaaaaaaaa99999999";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Authorization: ' . $key,
'Content-type: ' . $ContentType ,
'Accept: ' . $ContentType,
'X-LC-Application-Key: ' . $account_id));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
curl_close($ch);
return json_decode($output);
}
これは彼らのdocumentation次のとおりです。
このサブリソースには、投資家の口座の概要を提供します。
操作:https://api.lendingclub.com/api/investor/v1/accounts/[investor ID] /取引/
URLのパラメータ:: - ユーザーがログインしているとき、これは貸出クラブのウェブサイト上のアカウント 概要セクションから入手することができる投資家IDを
URLをGET
クエリパラメータ:なし。
対応フォーマット:購入のノートのためのJSON要求
リクエスト/レスポンスヘッダ:NAMEのTYPE NULLABLE DESCRIPTIONパートナーが はノートのための1つまたは複数のノートを購入するために要求しているその代理として時に投資家の 援助文字列なしのID配列番号1の配列 以上注loanId文字列いいえ が購入要求された貸出の数値識別子注記の順序noteId文字列いいえ注釈の数値識別子 bidPrice Stringいいえ正の数値値はドル($)でセントは を表す{loanId:707414のnoteId:4154191 bidPrice
{ buyNoteConfirmations: [ 3 ] : { loanId: 3349795 noteId: 5730626 bidPrice: 9.79 outstandingAccruedInterest: null outstandingPrincipal: null yieldToMaturity: null executionStatus: [ 1 ] : "
NOTE_DOES_NOT_EXIST "} 1対応 -
{ "aid":70654,"notes": [ {"loanId":3349795,"orderId":19979983,"noteId":5730626,"bidPrice":9.79}, {"loanId":707414,"orderId":1369944,"noteId":4154191,"bidPrice":23.84}, {"loanId":1076461,"orderId":2133757,"noteId":7827843,"bidPrice":34.45}
] }
サンプル - JSON:ノートサンプル要求のための所望の販売価格:23.84 outstandingAccruedInterest:null outstandingPrincipal:null yieldToMaturity:null executionStatus:[1]: " NOTE_NOT_AVAILABLE" } 2:{loanId:1076461のnoteId:7827843 bidPrice:34.45 outstandingAccruedInterest:ヌルoutstandingPrincipal:ヌルyieldToMaturity:ヌルexecutionStatus:[1] 0: " SUCCESS_PENDING_SETTLEMENT" }}
これは場合I何が起こるかでありますポストマン ポスティングデータでのテスト:
POST /api/investor/v1/accounts/87308218/trades/ HTTP/1.1
Host: api.lendingclub.com
Authorization: aaaaaaaaaaa111111
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 68d283a6-08f0-6789-3542-3a1baa554ce7
{
"aid":70654,"notes":
[
{"loanId":3349795,"orderId":19979983,"noteId":5730626,"bidPrice":9.79},
{"loanId":707414,"orderId":1369944,"noteId":4154191,"bidPrice":23.84},
{"loanId":1076461,"orderId":2133757,"noteId":7827843,"bidPrice":34.45}
]
}
と私は彼らのドキュメントが言うようにGETを使用してみました。
GET /api/investor/v1/accounts/87308218/trades/?aid=12345678&notes[0][loanId]=17213188&notes[0][orderId]=25300948&notes[0][noteId]=48382917&notes[0][bidPrice]=6.77&notes[1][loanId]=17213188&notes[1][orderId]=25300943&notes[1][noteId]=48382538&notes[1][bidPrice]=6.77 HTTP/1.1
Host: api.lendingclub.com
Authorization: aaaaaaaaaaa111111
Cache-Control: no-cache
Postman-Token: b34cb60b-91ea-c82e-349f-d395b01b1dc0
ありがとうございます!