-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest2-trello-api.js
More file actions
31 lines (22 loc) · 902 Bytes
/
test2-trello-api.js
File metadata and controls
31 lines (22 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*jslint node: true*/
'use strict';
var http = require("https");
var trelloApplicationKey = ''; //add application key
var trelloAPIToken = ''; //add api token
var trelloBoardId = ''; //add boardid
var trelloURL = 'https://api.trello.com/1/boards/'+trelloBoardId+'/cards?fields=name,idList,url&key='+trelloApplicationKey+'&token='+trelloAPIToken;
var request = http.get(trelloURL, function(response){
//console.log('STATUS:'+response.statusCode);
//console.log('HEADERS:'+JSON.stringify(response.headers));
response.setEncoding('utf8');
var responseString = '';
response.on('data', function(chunk){
responseString += chunk;
});
response.on('end', function(){
console.dir(JSON.parse(responseString));
});
});
request.on('error', function(error){
console.error('ERROR: ' + error.message);
});