Tag: trello

Trello响应“无效的密钥”

我正在尝试使用以下URL使用Node.js的https模块获取Trello板的JSON数据: https://trello.com/b/nC8QJJoZ.json 这是我的代码: var https = require('https'); https.get('https://trello.com/b/nC8QJJoZ.json', function (res) { console.log('statusCode:', res.statusCode); console.log('headers:'); console.log(res.headers); res.setEncoding('utf8'); res.on('data', function (chunk) { console.log(chunk); }); }).on('error', function (e) { console.log('ERROR: ' + e); }); 尽pipeURL在浏览器中完美工作,但它返回一个包含string“invalid key”的主体,其状态为401。 以下是输出: statusCode: 401 headers: { 'cache-control': 'max-age=0, must-revalidate, no-cache, no-store', 'x-content-type-options': 'nosniff', 'strict-transport-security': 'max-age=15768000', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'DENY', 'x-trello-version': '1.430.0', 'x-trello-environment': […]

在Trello上查找现有的Webhooks ID

我已经使用Trello的API( Node JS包 )添加了webhooks。 我如何获得当前的webhook,或者如何获得现有的webhook ID? 无法find通过API的方法: https : //developers.trello.com/advanced-reference/webhook 这里说: 有三种方法可以删除webhooks。 在webhook上使用DELETE路由DELETE https://api.trello.com/1/webhooks/[WEBHOOK_ID]?key=[APPLICATION_KEY]&token=[USER_TOKEN] 如果来自Trello的webhook请求在发送到callbackURL时收到HTTP 410 Gone响应,则WebHook将被删除。 如果webhook绑定的标记被撤销或过期,则webhook将被删除 第一种方法需要身份证,第二种方法要求我每次要删除一个webhook都取下服务器,第三种方法不是更好。 任何想法如何获得ID?

Angular.js API调用 – 我应该使用工厂吗?

我正在使用Trello API,Node.js(和Node-Trello软件包)和Angular.js( github repo )来开发Electron应用程序, 当用户授权他们的Trello应用程序时,我保存一些configuration文件数据; 其中一些是所有Trello板的ID列表。 我有一个控制器来处理显示他们的董事会名单。 在这个控制器中,我从数据库中提取板ID列表,并得到一个数组 ["893482938480", "0938492830"] 然后我调用一个函数,我传递了这个电路板ID的数组,像这样… // get data for boards $scope.get_board_data = function(boardIDArray) { for(var i = 0; i < boardIDs.length; i++){ t.get("/1/boards/" + boardIDs[i], function(err, data) { if (err) throw err; board_info = data; board_names.push(board_info['name']); $scope.board_names = board_names; //console.log($scope.board_names); return $scope.board_names }); } } $scope.board_array = $scope.get_board_data(boardIDs); […]

在JavaScript中正确检查空值

所以我一直在研究这个问题好几天,似乎无法find一个真正有效的答案。 我正在处理一个api(trello是具体的),当提供返回json对象在没有值的属性中放置一个NULL值。 我从api获取数据后parsing数据,并需要一种方法来跳过空值或删除它们。 例如,下面是一个空值对象的一部分: { name: 'blah', due: null, cards: [ [ [Object], [Object], [Object] ], [ [Object] ], [ [Object], [Object], [Object] ], null, [ [Object], [Object] ], [ [Object], [Object], [Object], [Object] ], [ [Object], [Object] ], [ [Object], [Object], [Object] ] ] } 到期属性被用作对别处拉出的date时间戳的覆盖。 现在我正在使用这似乎工作: if (!update.due) { update.lastUpdated = update.history[0].date; } […]

使用trello OAuth的授权路由,然后在哈希标签#

根据参考链接https://developers.trello.com/authorize ,我select使用授权路由在Trello上实现OAuth的第一种方式。 涉及的url请求是https://trello.com/1/authorize?return_url=http://xxx/union/callback/trello&namae=xxx&key=xxx&callback_method=xxx&scope=read&expiration=30days 最后,程序在浏览器位置停止,地址为http://xxx/union/callback/trello#token=a1418eb97b298edc9a7a83fb85107bad4d2861cf46ac897037002aff778c3927 。 在我看来,代币应该在“?”之后返回 代替 ”#”。 因为“#”后的string不会被发送到服务器。 对于这个问题,这是一个trello的OAuth的错误,或者我可以做任何事情继续?

使用node-trello模块发送发布请求

我是trello api的新手,我正在使用node.js。 GET请求与node.js工作正常,但是当我发送POST请求存储列表在特定的董事会,那么它给了我一个未经授权的错误。 我的代码是: t.post('/1/boards/board_id/lists?scope=read,write',{text:'test'}, function(err,data){ if(err){ console.log("err "+err); return res.send(err); } else{ console.log(data); return res.send(data); } }); 请任何人告诉我,我在做错什么。