私は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:
私は指示に従った。私は正しいidlistを使用しています。私はここに「私のリスト」と「私の鍵」と書いています。 – Tzvibe