2017-09-12 146 views
0

您好我是使用節點和rest API調用的新手。node js調用confluence API返回null

我發現這個節點JS的匯合的API包裝:https://github.com/johnpduane/confluence-api#Confluence+getSpace

var Confluence = require("confluence-api"); 
var config = { 
username: "<user>", 
password: "<pw>", 
baseUrl: "https://<page>.atlassian.net", 
}; 
var confluence = new Confluence(config); 
confluence.getSpace(<space name>, function(err, data) { 
// do something interesting with data; for instance, 
// data.results[0].body.storage.value contains the stored markup for the first 
// page found in space 'space-name' matching page title 'page-title' 
console.log(data) 
console.log(err) 
console.log(data.results[0].id); 
}); 

這樣做的回報是零。我不確定這是什麼意思 - 我沒有連接到我的匯合頁面?我誤解了如何使用API​​調用?

+0

你在哪裏運行此代碼?我的本地機器上有 –

+0

。 – Dennis

回答

0

首先,您必須詳細瞭解您的合流頁面。 baseurl:您的合流網址,https://yourdomain/confluence.rest/api/content 用戶名, 密碼與您登錄到您的合流時相同。 空間:空間名稱 版本:如果你想更新你的頁面通過node.js代碼 正文:數據