Ich bin neu mit Trello API. Wie von Trello vorgeschlagen, versuche ich die client.js-Bibliothek zu verwenden. Ich folgte den Anweisungen, und ich erhalte eine ‚erfolgreiche Authentifizierung‘ Nachricht in der Konsole, aber dennoch bekomme ich einen 401-Fehler (in der Konsole):Verwendung der client.js-Bibliothek für Trello API
POST https://api.trello.com/1/cards 401() jquery-1.7.1.min.js:4
Hier ist mein Code:
<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>
Irgendwelche Ideen? Danke.
Ich habe die Anweisungen befolgt. Ich verwende die richtige ID-Liste. Ich habe hier nur 'meine Liste' und 'mein Schlüssel' geschrieben. – Tzvibe