Giter Site home page Giter Site logo

confluence-api's Introduction

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-api

Create an instance of Confluence by providing a username and password (or token) and a baseUrl used for all future requests. Confluence uses basic http authentication. For instance:

var Confluence = require("confluence-api");
var config = {
    username: "testuser",
    password: "test-user-pw-or-rest-api-token",
    baseUrl:  "https://confluence-api-test.atlassian.net/wiki",
    version: 4 // Confluence major version, optional
};
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}

new Confluence(config)

Construct Confluence.

Param Type Description
config Object
config.username string
config.password string The password or REST API Token for the user (docs)
config.baseUrl string
config.version number Optional

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)

Get stored content for a specific page id with optional custom expanders.

Kind: instance method of Confluence

Param Type Description
options object for the custom content request
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, representation)

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
representation string Optional

confluence.putContent(space, id, version, title, content, callback, minorEdit, representation)

Put/update stored content for a page.

Kind: instance method of Confluence

Param Type Description
space string
id string
version number
title string
content string
callback function
minorEdit boolean Optional
representation string Optional

confluence.deleteContent(id, callback)

Delete a page.

Kind: instance method of Confluence

Param Type
id string
callback function

confluence.getAttachments(space, id, callback)

Get attachments

Kind: instance method of Confluence

Param Type
space string
id string
callback function

confluence.createAttachment(space, id, filepath, callback)

This allows you to post attachments to the pages you create.

Kind: instance method of Confluence

Param Type Description
space string
id string
filepath string absolute path of the file you are sending
callback function

confluence.updateAttachmentData(space, id, attachmentId, filepath, callback)

This allows you to update posted attachments data

Kind: instance method of Confluence

Param Type
space string
id string
attachmentId string
filepath string
callback function

confluence.getLabels(id, callback)

Get labels from content

Kind: instance method of Confluence

Param Type
id string
callback function

confluence.postLabels(id, labels, callback)

Post content labels to a existing page.

Kind: instance method of Confluence

Param Type
id string
labels Array.<{prefix:string, name:string}>
callback function

confluence.deleteLabel(id, label, callback)

Delete a label from a page.

Kind: instance method of Confluence

Param Type
id string
label string
callback function

confluence.search(query, callback)

Search by query

Kind: instance method of Confluence

Param Type
query string
callback function

request

Node.js wrapper for Atlassian's Confluence API. See https://developer.atlassian.com/confdev/confluence-rest-api

Copyright (c) 2015, John Duane Released under the MIT License

confluence-api's People

Contributors

johnpduane avatar mlersch avatar rnhurt avatar qvaqvaboo avatar lukouko avatar arthmoeros avatar

Watchers

Zo-Hasina Rasatavohary avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.