Package Exports
- confluence-api
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (confluence-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Confluence API
This project contains a Node.js module which wraps Atlassian's Confluence API.
Getting Started
Install confluence-api via npm:
$ npm install confluence-apiCreate an instance of Confluence by providing a username and password (Confluence uses basic http authentication) and a baseUrl used for all future requests. For instance:
var Confluence = require("confluence-api");
var config = {
username: "testuser",
password: "test-user-pw",
baseUrl: "https://confluence-api-test.atlassian.net/wiki"
};
var confluence = new Confluence(config);
confluence.getContentByPageTitle("space-name", "page-title", 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);
});Confluence currently exposes the following API...
Confluence
Kind: global class
this: {Confluence}
- Confluence
- new Confluence(config)
- .getSpace(space, callback)
- .getSpaceHomePage(space, callback)
- .getContentById(id, callback)
- .getContentByPageTitle(space, title, callback)
- .postContent(space, title, content, parentId, callback)
- .putContent(space, id, version, title, content, callback)
- .deleteContent(id, callback)
new Confluence(config)
Construct Confluence.
| Param | Type |
|---|---|
| config | Object |
| config.username | string |
| config.password | string |
| config.baseUrl | string |
confluence.getSpace(space, callback)
Get space information.
Kind: instance method of Confluence
| Param | Type |
|---|---|
| space | string |
| callback | function |
confluence.getSpaceHomePage(space, callback)
Get space home page.
Kind: instance method of Confluence
| Param | Type |
|---|---|
| space | string |
| callback | function |
confluence.getContentById(id, callback)
Get stored content for a specific space and page title.
Kind: instance method of Confluence
| Param | Type |
|---|---|
| id | string |
| callback | function |
confluence.getCustomContentById(options, callback)
The options object format is as follows: { id: "1234" // Mandatory. page id from which to get content. expanders: ['metadata'] // Optional. Array of content members to expand. Defaults to ['versions', 'body.storage'] }
Kind: instance method of Confluence
| Param | Type |
|---|---|
| options | object |
| callback | function |
confluence.getContentByPageTitle(space, title, callback)
Get stored content for a specific space and page title.
Kind: instance method of Confluence
| Param | Type |
|---|---|
| space | string |
| title | string |
| callback | function |
confluence.postContent(space, title, content, parentId, callback)
Post content to a new page.
Kind: instance method of Confluence
| Param | Type | Description |
|---|---|---|
| space | string |
|
| title | string |
|
| content | string |
|
| parentId | number |
A null value will cause the page to be added under the space's home page |
| callback | function |
confluence.putContent(space, id, version, title, content, callback)
Put/update stored content for a page.
Kind: instance method of Confluence
| Param | Type |
|---|---|
| space | string |
| id | string |
| version | number |
| title | string |
| content | string |
| callback | function |
confluence.deleteContent(id, callback)
Delete a page.
Kind: instance method of Confluence
| Param | Type |
|---|---|
| id | string |
| callback | function |
Copyright (c) 2015, John Duane Released under the MIT License