2016-04-10 5 views
1

私はtrello APIで新しくなっています。 Trelloが提案したように、私はclient.jsライブラリを使用しようとしています。 私は指示に従った、と私は、コンソールに「成功した認証」というメッセージを取得し、まだ私は(コンソールで)401エラーが表示されます。ここではTrello API用のclient.jsライブラリの使用

POST https://api.trello.com/1/cards 401()   jquery-1.7.1.min.js:4 

は私のコードです:

<head> 
    <title>Trello api</title> 

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> 
<script src="https://api.trello.com/1/client.js?  
    key=[my key]"></script> 
</head> 
<body> 
    <script> 
     var authenticationSuccess = function() { console.log('Successful 
     authentication'); }; 
     var authenticationFailure = function() { console.log('Failed  
     authentication'); }; 

Trello.authorize({ 
     type: 'popup', 
     name: 'Getting Started Application', 
     scope: { 
     read: true, 
     write: true }, 
     expiration: 'never', 
     success: authenticationSuccess, 
     error: authenticationFailure 
     }); 


var myList = 'my list'; 
var creationSuccess = function(data) { 
     console.log('Card created successfully. Data returned:' + 
     JSON.stringify(data)); 
}; 
var newCard = { 
     name: 'New Test Card', 
     desc: 'This is the description of our new card.', 
     idList: myList, 
     pos: 'top' 
     }; 
    Trello.post("cards", newCard, creationSuccess); 


    </script> 

アイデア?おかげさまで 正しいidList値を取得するためにhttps://developers.trello.com/get-started/start-building

答えて

0

問題は存在しないidList、「私のリスト」あなたはここに指示に従う必要があり

を供給しています。

'

+0

私は指示に従った。私は正しいidlistを使用しています。私はここに「私のリスト」と「私の鍵」と書いています。 – Tzvibe

0

私は同じ問題がありました。私はhttp://jsfiddle.net/A3Xgk/2/から「ログイン」と「ログアウト」を取っています。

Trello.authorize({ 
    interactive: false, 
    success: onAuthorize 
}); 

$("#connectLink").click(function() { 
    Trello.authorize({ 
     type: "popup", 
     success: onAuthorize 
    }); 
}); 

助けにならない場合は、私に書いてください、私はあなたに私のコードを教えてください。