This page last changed on Feb 07, 2007 by jnolen.
Introduction
Confluence provides remote APIs as both XML-RPC and SOAP. This document refers to the XML-RPC specification, see SOAP details below. XML-RPC and SOAP are both remote choices, as they have bindings for almost every language making them very portable.
Which should I use?
- SOAP is generally more useful from a strongly typed language (like Java or C#) but these require more setup.
- XML-RPC is easier to use from a scripting language (like Perl, Python, AppleScript etc) and hence is often quicker to use.
 | Looking for the JIRA remote APIs? They are here. |
XML-RPC
 | Read Me First!
XML-RPC notes: (some borrowed from the VPWik specification)
- The URL for XML-RPC requests is http://confluence-install/rpc/xmlrpc.
- All XML-RPC methods must be prefixed by confluence1. - to indicate this is version 1 of the API. We might introduce another version in the future. For example to call the getPage method, the method name is confluence1.getPage .
- All keys in structs are case sensitive.
- All strings are passed as UTF-8, and not ASCII per the XML-RPC update on 6/30/2003
- Confluence uses 64 big long values for things like object IDs, but XML-RPC's largest supported numeric type is int32. As such, all IDs and other long values must be converted to Strings when passed through XML-RPC API.
- Anywhere you see the word Vector, you can interchange it with "Array" or "List" depending on what language you prefer. This is the array data type as defined in the XML-RPC spec.
- Anywhere you see the word Hashtable, you can interchange it with "Struct" or "Dictionary" or "Map" depending on what language you prefer. This is the struct data type as defined in the XML-RPC spec.
- The default session lifetime is 30 minutes, but that can be controlled by the deployer from the applicationContext.xml file.
|
SOAP
The SOAP API follows the same methods as below, except with typed objects (as SOAP allows for).
To find out more about the SOAP API, simply point your SOAP 'stub generator' at the WSDL file, located at http://<confluence-install>/rpc/soap-axis/confluenceservice-v1?wsdl .
For reference, the confluence.atlassian.com WSDL file is here.
Changelog
2.3
- Added getClusterInformation and getClusterNodeStatuses.
2.2
- Added addPersonalSpace, convertToPersonalSpace and addProfilePicture.
2.1.4
- Added getPermissionsForUser.
2.0
- Updated getLocks() to getPagePermissions()
- Added addAttachment, getAttachment, getAttachmentData, removeAttachment and moveAttachment methods to allow remote attachment handling. Note that adding large attachments with this API uses a lot of memory during the addAttachment operation.
- Added addAnonymousPermissionToSpace, addAnonymousPermissionsToSpace and removeAnonymousPermissionFromSpace.
- Added the addComment and removeComment methods for comment manipulation.
- Added hasGroup and hasUser methods to determine if a group or user exists.
- Added editUser method.
- Added ability to deactivate and reactivate users.
- Added getActiveUsers method to retrieve a user list.
- Added ability to change the user password.
- Added ability to retrieve and modify user information.
- Added ability to retrieve, add and remove labels.
- Added getBlogEntryByDayAndTitle
1.4
- Added new exportSpace and exportSite methods to build exports of an individual space or an entire Confluence instance and return with a URL leading to the download.
- Added new getChildren and getDescendents methods to get the direct children and all descendents of a given page.
- Added new getAncestors method to get the ancestors of a given page.
- Removed the old getLocks as locks are superceded by page level permissions.
- Added new getPagePermissions method to retrieve page level permissions.
- Added new removeUser, removeGroup, removeAllPermissionsForGroup, addUserToGroup and removeUserFromGroup methods.
- Added new addPermissionToSpace method.
- Added new Permission data object.
- Added new getSpaceLevelPermissions method.
1.3
- Added new getPage method which retrieves a page by space key and page title.
- Added new removeSpace method to remove an entire space.
- Added ability to limit search by parameters.
- Allow anonymous access.
1.2
- renderContent takes an optional hashtable for rendering hints, the only one supported right now is "style=clean"
1.1
- getLocks gives you back a list of any locks that apply to a given page
- added a locks field to the various Page structs containing a count of any applicable page-level locks
- CRUD methods added for blog-posts
1.0.3
- getServerInfo gives you some basic information about the server version CONF1123
- storePage now allows you to change the page's name (incoming links are all renamed) CONF-974
- storePage now reliably allows you to re-parent pages
- WSDL now respects the server's configured base URL, allowing it to work on proxy-hosted servers CONF-1088
Remote Methods
Authentication Methods
- String login(String username, String password) - login a user. Returns a String authentication token to be passed as authentication to all other remote calls. It's not bulletproof auth, but it will do for now. Must be called before any other method in a 'remote conversation'. From 1.3 onwards, you can supply an empty string as the token to be treated as being the anonymous user.
- boolean logout(String token) - remove this token from the list of logged in tokens. Returns true if the user was logged out, false if they were not logged in in the first place (we don't really need this return, but void seems to kill XML-RPC for me)
Administration
- String exportSite(String token, boolean exportAttachments) - exports a Confluence instance and returns a String holding the URL for the download. The boolean argument indicates whether or not attachments ought to be included in the export.
- ClusterInformation getClusterInformation(String token) - returns information about the cluster this node is part of.
- Vector getClusterNodeStatuses(String token) - returns a Vector of NodeStatus objects containing information about each node in the cluster.
General
- ServerInfo getServerInfo(String token) - retrieve some basic information about the server being connected to. Useful for clients that need to turn certain features on or off depending on the version of the server. (Since 1.0.3)
Spaces
Retrieval
- Vector getSpaces(String token) - returns all the SpaceSummaries that the current user can see.
- Space getSpace(String token, String spaceKey) - returns a single Space.
- String exportSpace(String token, String spaceKey, String exportType) - exports a space and returns a String holding the URL for the download. The export type argument indicates whether or not to export in XML, PDF, or HTML format - use "TYPE_XML", "TYPE_PDF", or "TYPE_HTML" respectively. Also, using "all" will select TYPE_XML.
Management
- Space addSpace(String token, Space space) - create a new space, passing in name, key and description.
- Boolean removeSpace(String token, String spaceKey) - remove a space completely.
- Space addPersonalSpace(String token, Space personalSpace, String userName) - add a new space as a personal space.
- boolean convertToPersonalSpace(String token, String userName, String spaceKey, String newSpaceName, boolean updateLinks) - convert an existing space to a personal space.
Pages
Retrieval
- Vector getPages(String token, String spaceKey) - returns all the PageSummaries in the space. Doesn't include pages which are in the Trash. Equivalent to calling Space.getCurrentPages().
- Page getPage(String token, String pageId) - returns a single Page
- Page getPage(String token, String spaceKey, String pageTitle) - returns a single Page
- Vector getPageHistory(String token, String pageId) - returns all the PageHistorySummaries - useful for looking up the previous versions of a page, and who changed them.
- Vector getPagePermissions(String token, String pageId) - returns the page level permissions for this page (since 1.4)
Dependencies
- Vector getAttachments(String token, String pageId) - returns all the Attachments for this page (useful to point users to download them with the full file download URL returned).
- Vector getAncestors(String token, String pageId) - returns all the ancestors (as PageSummaries) of this page (parent, parent's parent etc).
- Vector getChildren(String token, String pageId) - returns all the direct children (as PageSummaries) of this page.
- Vector getDescendents(String token, String pageId) - returns all the descendents (as PageSummaries) of this page (children, children's children etc).
- Vector getComments(String token, String pageId) - returns all the comments for this page.
- Comment getComment(String token, String commentId) - returns an individual comment.
- Comment addComment(String token, Comment comment) - adds a comment to the page.
- boolean removeComment(String token, String commentId) - removes a comment from the page.
Management
- Page storePage(String token, Page page) - add or update a page. For adding, the Page given as an argument should have space, title and content fields at a minimum. For updating, the Page given should have id, space, title, content and version fields at a minimum. The parentId field is always optional. All other fields will be ignored.
- String renderContent(String token, String spaceKey, String pageId, String content) - returns the HTML rendered content for this page. If 'content' is provided, then that is rendered as if it were the body of the page (useful for a 'preview page' function). If it's not provided, then the existing content of the page is used instead (ie useful for 'view page' function).
- String renderContent(String token, String spaceKey, String pageId, String content, Hashtable parameters) - Like the above renderContent(), but you can supply an optional hash (map, dictionary, etc) containing additional instructions for the renderer. Currently, only one such parameter is supported:
- "style = clean" Setting the "style" parameter to "clean" will cause the page to be rendered as just a single block of HTML within a div, without the HTML preamble and stylesheet that would otherwise be added.
- void removePage(String token, String pageId) - remove a page
Attachments - new in version 2.0
Retrieval
- Attachment getAttachment(String token, String pageId, String fileName, String versionNumber) - get information about an attachment.
- byte[] getAttachmentData(String token, String pageId, String fileName, String versionNumber) - get the contents of an attachment.
Management
- Attachment addAttachment(String token, long contentId, Attachment attachment, byte[] attachmentData) - add a new attachment to a content entity object. Note that this uses a lot of memory - about 4 times the size of the attachment. The 'long contentId' is actually a String pageId for XML-RPC.
- boolean removeAttachment(String token, String contentId, String fileName) - remove an attachment from a content entity object.
- boolean moveAttachment(String token, String originalContentId, String originalName, String newContentEntityId, String newName) - move an attachment to a different content entity object and/or give it a new name.
Blog Entries
- Vector getBlogEntries(String token, String spaceKey) - returns all the BlogEntrySummaries in the space.
- BlogEntry getBlogEntry(String token, String pageId) - returns a single BlogEntry.
- BlogEntry storeBlogEntry(String token, BlogEntry entry) - add or update a blog entry. For adding, the BlogEntry given as an argument should have space, title and content fields at a minimum. For updating, the BlogEntry given should have id, space, title, content and version fields at a minimum. All other fields will be ignored.
- BlogEntry getBlogEntryByDayAndTitle(String token, String spaceKey, int dayOfMonth, String postTitle) - Retrieves a blog post in the Space with the given spaceKey, with the title 'postTitle' and posted on the day 'dayOfMonth'.
Search
- Vector search(String token, String query, int maxResults) - return a list of SearchResults which match a given search query (including pages and other content types). This is the same as a performing a parameterised search (see below) with an empty parameter map.
- Vector search(String token, String query, Map parameters, int maxResults) - (since 1.3) like the previous search, but you can optionally limit your search by adding parameters to the parameter map. If you do not include a parameter, the default is used instead.
Parameters for Limiting Search Results
key |
description |
values |
default |
spaceKey |
search a single space |
(any valid space key) |
Search all spaces |
type |
Limit types of search results to return |
all
page
blogpost
mail
comment
attachment
spacedescription
personalinformation |
All except mail |
lastModified |
Search recently modified content |
today
yesterday
lastweek
lastmonth |
No limit |
Security
- Vector getPermissions(String token, String spaceKey) - Returns a Vector of Strings representing the permissions the current user has for this space (a list of "view", "modify", "comment" and / or "admin").
- Vector getPermissionsForUser(String token, String spaceKey, String userName) - Returns a Vector of Strings representing the permissions the given user has for this space. (since 2.1.4)
- Vector getPagePermissions(String token, String pageId) - Returns a Vector of Permissions representing the permissions set on the given page.
- Vector getSpaceLevelPermissions(String token) - returns all of the space level permissions which may be granted. This is a list of possible permissions to use with addPermissionToSpace, below, not a list of current permissions on a Space.
- boolean addPermissionToSpace(String token, String permission, String remoteEntityName, String spaceKey) - Give the entity named remoteEntityName (either a group or a user) the permission permission on the space with the key spaceKey.
- boolean addPermissionsToSpace(String token, Vector permissions, String remoteEntityName, String spaceKey) - Give the entity named remoteEntityName (either a group or a user) the permissions permissions on the space with the key spaceKey.
- boolean removePermissionFromSpace(String token, String permission, String remoteEntityName, String spaceKey) - Remove the permission permission} from the entity named {{remoteEntityName (either a group or a user) on the space with the key spaceKey.
- boolean addAnonymousPermissionToSpace(String token, String permission, String spaceKey) - Give anonymous users the permission permission on the space with the key spaceKey. (since 2.0)
- boolean addAnonymousPermissionsToSpace(String token, Vector permissions, String spaceKey) - Give anonymous users the permissions permissions on the space with the key spaceKey. (since 2.0)
- boolean removeAnonymousPermissionFromSpace(String token, String permission,String spaceKey) - Remove the permission permission} from anonymous users on the space with the key {{spaceKey. (since 2.0)
- boolean removeAllPermissionsForGroup(String token, String groupname) - Remove all the global and space level permissions for groupname.
User Management
- User getUser(String token, String username) - get a single user
- void addUser(String token, User user, String password) - add a new user with the given password
- void addGroup(String token, String group) - add a new group
- Vector getUserGroups(String token, String username) - get a user's current groups
- void addUserToGroup(String token, String username, String groupname) - add a user to a particular group
- boolean removeUserFromGroup(String token, String username, String groupname) - remove a user from a group.
- boolean removeUser(String token, String username) - delete a user.
- boolean removeGroup(String token, String groupname, String defaultGroupName) - remove a group. If defaultGroupName is specified, users belonging to groupname will be added to defaultGroupName.
- Vector getGroups(String token) - gets all groups
- boolean hasUser(String token, String username) - checks if a user exists
- boolean hasGroup(String token, String groupname) - checks if a group exists
- boolean editUser(String token, RemoteUser remoteUser) - edits the details of a user
- boolean deactivateUser(String token, String username) - deactivates the specified user
- boolean reactivateUser(String token, String username) - reactivates the specified user
- Vector getActiveUsers(String token, boolean viewAll) - returns all registered users
- boolean setUserInformation(String token, UserInformation userInfo) - updates user information
- UserInformation getUserInformation(String token, String username) - Retrieves user information
- boolean changeMyPassword(String token, String oldPass, String newPass) - changes the current user's password
- boolean changeUserPassword(String token, String username, String newPass) - changes the specified user's password
- boolean addProfilePicture(String token, String userName, String fileName, String mimeType, byte[] pictureData) - add and set the profile picture for a user.
Labels
- Vector getLabelsById(String token, long objectId) - Returns all Labels for the given ContentEntityObject ID
- Vector getMostPopularLabels(String token, int maxCount) - Returns the most popular Labels for the Confluence instance, with a specified maximum number.
- Vector getMostPopularLabelsInSpace(String token, String spaceKey, int maxCount) - Returns the most popular Labels for the given spaceKey, with a specified maximum number of results.
- Vector getRecentlyUsedLabels(String token, int maxResults) - Returns the recently used Labels for the Confluence instance, with a specified maximum number of results.
- Vector getRecentlyUsedLabelsInSpace(String token, String spaceKey, int maxResults) - Returns the recently used Labels for the given spaceKey, with a specified maximum number of results.
- Vector getSpacesWithLabel(String token, String labelName) - Returns an array of Spaces that have been labelled with labelName.
- Vector getRelatedLabels(String token, String labelName, int maxResults) - Returns the Labels related to the given label name, with a specified maximum number of results.
- Vector getRelatedLabelsInSpace(String token, String labelName, String spaceKey, int maxResults) - Returns the Labels related to the given label name for the given spaceKey, with a specified maximum number of results.
- Vector getLabelsByDetail(String token, String labelName, String namespace, String spaceKey, String owner) - Retrieves the Labels matching the given labelName, namespace, spaceKey or owner.
- Vector getLabelContentById(String token, long labelId) - Returns the content for a given label ID
- Vector getLabelContentByName(String token, String labelName) - Returns the content for a given label name.
- Vector getLabelContentByObject(String token, Label labelObject) - Returns the content for a given Label object.
- Vector getSpacesContainingContentWithLabel(String token, String labelName) - Returns all Spaces that have content labelled with labelName.
- boolean addLabelByName(String token, String labelName, long objectId) - Adds a label to the object with the given ContentEntityObject ID.
- boolean addLabelById(String token, long labelId, long objectId) - Adds a label with the given ID to the object with the given ContentEntityObject ID.
- boolean addLabelByObject(String token, Label labelObject, long objectId) - Adds the given label object to the object with the given ContentEntityObject ID.
- boolean addLabelByNameToSpace(String token, String labelName, String spaceKey) - Adds a label to the object with the given ContentEntityObject ID.
- boolean removeLabelByName(String token, String labelName, long objectId) - Removes the given label from the object with the given ContentEntityObject ID.
- boolean removeLabelById(String token, long labelId, long objectId) - Removes the label with the given ID from the object with the given ContentEntityObject ID.
- boolean removeLabelByObject(String token, Label labelObject, long objectId) - Removes the given label object from the object with the given ContentEntityObject ID.
- boolean removeLabelByNameFromSpace(String token, String labelName, String spaceKey) - Removes the given label from the given spaceKey.
Data Objects
Most returned structs have a summary and a detailed form:
- The summary form is a primary key (ie space key, page id) and a representative form (ie space name, page title)
- The detailed form will have all of the entity details as might be needed for the client.
Unless otherwise specified, all returned structs are in detailed form.
ServerInfo
Key |
Type |
Value |
majorVersion |
int |
the major version number of the Confluence instance |
minorVersion |
int |
the minor version number of the Confluence instance |
patchLevel |
int |
the patch-level of the Confluence instance |
buildId |
String |
the build ID of the Confluence instance (usually a number) |
developmentBuild |
Boolean |
Whether the build is a developer-only release or not |
baseUrl |
String |
The base URL for the confluence instance |
Note: Version 1.0.3 of Confluence would be major-version: 1, minor-version: 0, patch-level: 3. Version 2.0 would have a patch-level of 0, even if it's not visible in the version number.
SpaceSummary
Key |
Type |
Value |
key |
String |
the space key |
name |
String |
the name of the space |
type |
String |
type of the space |
url |
String |
the url to view this space online |
Space
Key |
Type |
Value |
key |
String |
the space key |
name |
String |
the name of the space |
url |
String |
the url to view this space online |
homepage |
String |
the id of the space homepage |
description |
String |
the HTML rendered space description |
PageSummary
Key |
Type |
Value |
id |
String |
the id of the page |
space |
String |
the key of the space that this page belongs to |
parentId |
String |
the id of the parent page |
title |
String |
the title of the page |
url |
String |
the url to view this page online |
locks |
int |
the number of locks current on this page |
Page
Key |
Type |
Value |
id |
String |
the id of the page |
space |
String |
the key of the space that this page belongs to |
parentId |
String |
the id of the parent page |
title |
String |
the title of the page |
url |
String |
the url to view this page online |
version |
int |
the version number of this page |
content |
String |
the page content |
created |
Date |
timestamp page was created |
creator |
String |
username of the creator |
modified |
Date |
timestamp page was modified |
modifier |
String |
username of the page's last modifier |
homePage |
Boolean |
whether or not this page is the space's homepage |
locks |
int |
the number of locks current on this page |
contentStatus |
String |
status of the page (eg. current or deleted) |
current |
Boolean |
whether the page is current and not deleted |
PageHistorySummary
Key |
Type |
Value |
id |
String |
the id of the historical page |
version |
int |
the version of this historical page |
modifier |
String |
the user who made this change |
modified |
Date |
timestamp change was made |
BlogEntrySummary
Key |
Type |
Value |
id |
String |
the id of the blog entry |
space |
String |
the key of the space that this blog entry belongs to |
title |
String |
the title of the blog entry |
url |
String |
the url to view this blog entry online |
locks |
int |
the number of locks current on this page |
publishDate |
Date |
the date the blog post was published |
BlogEntry
Key |
Type |
Value |
id |
String |
the id of the blog entry |
space |
String |
the key of the space that this blog entry belongs to |
title |
String |
the title of the page |
url |
String |
the url to view this blog entry online |
version |
int |
the version number of this blog entry |
content |
String |
the blog entry content |
locks |
int |
the number of locks current on this page |
Key |
Type |
Value |
url |
String |
the URL of the RSS feed |
title |
String |
the feed's title |
Search Result
Key |
Type |
Value |
title |
String |
the feed's title |
url |
String |
the remote URL needed to view this search result online |
excerpt |
String |
a short excerpt of this result if it makes sense |
type |
String |
the type of this result - page, comment, spacedesc, attachment, userinfo, blogpost |
id |
String |
the long ID of this result (if the type has one) |
Attachment
Key |
Type |
Value |
id |
String |
numeric id of the attachment |
pageId |
String |
page ID of the attachment |
title |
String |
title of the attachment |
fileName |
String |
file name of the attachment (Required) |
fileSize |
String |
numeric file size of the attachment in bytes |
contentType |
String |
mime content type of the attachment (Required) |
created |
Date |
creation date of the attachment |
creator |
String |
creator of the attachment |
url |
String |
url to download the attachment online |
comment |
String |
comment for the attachment (Required) |
Key |
Type |
Value |
id |
String |
numeric id of the comment |
pageId |
String |
page ID of the comment |
title |
String |
title of the comment |
content |
String |
notated content of the comment (use renderContent to render) |
url |
String |
url to view the comment online |
created |
Date |
creation date of the attachment |
creator |
String |
creator of the attachment |
User
Key |
Type |
Value |
name |
String |
the username of this user |
fullname |
String |
the full name of this user |
email |
String |
the email address of this user |
url |
String |
the url to view this user online |
Permission
Key |
Type |
Value |
lockType |
String |
The type of permission. One of 'View' or 'Edit' |
lockedBy |
String |
The user or group name of the permission's owner |
Label
Key |
Type |
Value |
name |
String |
the nameof the label |
owner |
String |
the username of the owner |
namespace |
String |
the namespace of the label |
id |
String |
the ID of the label |
Key |
Type |
Value |
username |
String |
the username of this user |
content |
String |
the user description |
creatorName |
String |
the creator of the user |
lastModifierName |
String |
the url to view this user online |
version |
int |
the version |
id |
String |
the ID of the user |
creationDate |
Date |
the date the user was created |
lastModificationDate |
Date |
the date the user was last modified |
Key |
Type |
Value |
isRunning |
boolean |
true if this node is part of a cluster. |
name |
String |
the name of the cluster. |
memberCount |
int |
the number of nodes in the cluster, including this node (this will be zero if this node is not clustered.) |
description |
String |
a description of the cluster. |
multicastAddress |
String |
the address that this cluster uses for multicasr communication. |
multicastPort |
String |
the port that this cluster uses for multicast communication. |
NodeStatus
Key |
Type |
Value |
nodeId |
int |
an integer uniquely identifying the node within the cluster. |
jvmStats |
Map |
a Map containing attributes about the JVM memory usage of node. Keys are "total.memory", "free.memory", "used.memory". |
props |
Map |
a Map containing attributes of the node. Keys are "system.date", "system.time", "system.favourite.colour", "java.version", "java.vendor",
"jvm.version", "jvm.vendor", "jvm.implemtation.version", "java.runtime", "java.vm", "user.name.word", "user.timezone",
"operating.system", "os.architecture", "fs.encoding". |
buildStats |
Map |
a Map containing attributes of the build of Confluence running on the node. Keys are "confluence.home", "system.uptime", "system.version",
"build.number". |
Scripts examples
The Confluence Extension space contains various examples of scripts
We need a getShoortcuts() method. I'm writing a external exporter, and without this I can't render shortcut links correctly.

Posted by at Mar 15, 2004 03:59
|
Does this interoperate with JSPWiki & VoodooPad's XML-RPC interfaces ?

Posted by at Apr 01, 2004 09:18
|
No, it doesn't interroperate with either. The JSPWiki interface is too primitive to do all the things we need, and VoodooPad now integrates with the Confluence APIs AFAIK.

Posted by mike@atlassian.com at Nov 04, 2004 17:03
|
Any way to change a user's password via remote API?

Posted by at Jul 21, 2005 11:45
|
No. Not at the moment.

Posted by dave@atlassian.com at Jul 21, 2005 11:51
|
I've pulled my hair out to get the addAttachement method working. The signature above is wrong, because it now has four parameters. The second one (content id) is missing.
It would be great if the confluence xml-rpc service would support server introspection via system.listMethods so one could use tools like xml-rpc-api2txt to get the actual interface description.

Posted by bfeustel at Nov 22, 2005 03:21
|
Hi Björn,
I have created CONF-4712 to look into solving the remote api documentation problem once and for all. Please add any comments to this issue.
Regards,
-Daniel

Posted by daniel@atlassian.com at Nov 22, 2005 17:52
|
While I'm on the topic, CONF-4714 fixes this inconsistency.

Posted by daniel@atlassian.com at Nov 22, 2005 18:12
|
Hi,
How do I set a permission on a page? I know I can getPagePermission() but i don't see a setPagePermission()
thanks
Dan

Posted by dan_an_fear at Nov 23, 2005 09:03
|
Hi Dan,
Currently, there is no way to set page permissions via the Remote API. We have an issue for this at CONF-3908, which you can follow if you want.
Jeremy.

Posted by jeremy@atlassian.com at Nov 24, 2005 00:01
|
As of Confluence 2.0, it is possible to change a user's password via the Remote API.
To change your password, use the following method:
boolean changeMyPassword(String token, String oldPass, String newPass)
To change another user's password (requires admin permission), use the following method:
boolean changeUserPassword(String token, String username, String newPass)

Posted by jeremy@atlassian.com at Nov 24, 2005 00:10
|
Any chance of the Confluence data types in the Remote Methods section being linked to their description further down the page? E.g:
- ServerInfo getServerInfo(String token) - retrieve some basic information about the server being connected to. Useful for clients that need to turn certain features on or off depending on the version of the server. (Since 1.0.3)
That would make it much simpler to read the docs, rather than scrolling at random...
And if you're feeling really generous, the data type description could link back to methods which make use of it also 

Posted by david@randombits.org at Nov 29, 2005 18:38
|
Good idea, David. I've filed this as CONF-4848

Posted by cmiller at Dec 06, 2005 00:58
|
The documentation for lastModified as part of the search method should also note that it is legal to use the 2w, 1d, 3h notations.

Posted by ben@walding.com at Dec 15, 2005 23:28
|
exportSpace and exportSite are nice but would be more useful if they could also be restored (restoreSpace, restoreSite).

Posted by bob.swift@charter.net at Jan 19, 2006 22:40
|
OK, that's what I'm using now. I'll verify that it's getting passed properly, but thanks for the sanity-check.

Posted by eric@transmeta.com at Jan 25, 2006 21:52
|
I've been able to call the String exportSpace(String token, String spaceKey, String exportType) method and get a String representation for the download url. However when I try to download, I get a 403 error. Any solution for this? Thanks
java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/download/temp\export_01272006_164839\ds-20060127-16_48_41.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1149)

Posted by thomasvdv at Jan 27, 2006 09:50
|
Hi Thomas,
If you change the backslashes in the URL to forward slashes, does it work? How have you defined your confluence.home directory?
Jeremy

Posted by jeremy@atlassian.com at Jan 29, 2006 18:03
|
I tried with HttpClient and it work, on the default install we have to initiated a login since the LoginFilter will kick you out if you don't.
HttpClient client = new HttpClient();
HttpState initialState = new HttpState();
Cookie mycookie = new Cookie("localhost", "mycookie", "download", "/", null, false);
initialState.addCookie(mycookie);
initialState.setCookiePolicy(CookiePolicy.RFC2109);
client.setConnectionTimeout(30000);
client.setState(initialState);
PostMethod post = new PostMethod("http://localhost:8081/confluence/login.action");
post.addParameter("os_username", "admin");
post.addParameter("os_password", "*****");

Posted by roshan.gunoo@accenture.com at Feb 14, 2006 10:39
|
Certainly you can 'screen scrape' Confluence using HttpClient, but the value of the remote interface is that it is documented, so you don't need to examine Confluence's HTML, which may change without warning at any time.

Posted by tom@atlassian.com at Feb 14, 2006 17:09
|
Is there anyway to remotly add external content to the search index to make it also available in the confluence internal search?

Posted by benjamin klatt at Feb 15, 2006 04:23
|
At the moment, no. But there's a feature request to allow indexing of external content in Confluence: CONF-1436
Once that is implemented in Confluence, I imagine it won't be hard to provide a remote API.

Posted by mryall at Feb 15, 2006 16:50
|
Try adding ?os_username=your_username&os_password=your_password onto the end of the URL. That will log you in at the same time as you are downloading the file.

Posted by cmiller at Feb 15, 2006 18:16
|
I had same problem and adding the user name and password didn't help.
java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost/download/temp/Test-20060218-22_41_43.zip?os_username=automation&os_password=xxxxx

Posted by bob.swift@charter.net at Feb 18, 2006 22:43
|
Thanks, Bob. I've replicated this problem.
I've raised CONF-5533 to get it fixed.

Posted by mryall at Feb 20, 2006 18:24
|
Matt, thanks for fixing this. I will check it out when 2.1.5 is available.

Posted by bob.swift@charter.net at Feb 21, 2006 22:15
|
ChangeMyPassword seen to have the same functionality as changeUserPassword, is this a bug??

Posted by justin20 at Feb 23, 2006 19:22
|
changeMyPassword can be used by any user to change their own password, while changeUserPassword is used by an administrator to change any user's password.

Posted by tom@atlassian.com at Feb 23, 2006 19:28
|
I mean I get error when i try to do the following
String token = confluenceSoapService.login("aa","222222");
successful get token
confluenceSoapService.changeMyPassword(token, "222222","222222")
error
but if I login as a adminsitrator user token I can do the following
confluenceSoapService.changeMyPassword(token, "aa","333333")
password successful change

Posted by justin20 at Feb 23, 2006 21:58
|
Hi Justin,
Can you post the error you're getting when you call changeMyPassword? You may want to create a support request at http://support.atlassian.com/, where we can discuss it privately.
Jeremy

Posted by jeremy@atlassian.com at Feb 26, 2006 23:07
|
RE: getAttachment(String token, String pageId, String fileName, String versionNumber)
If you provide a version of 0 or less, you'll get the most recent version of the attachment.

Posted by cherylchase at Apr 03, 2006 21:38
|
I've created a Java client for the Confluence XMLRPC that is strongly typed and open source so it can be included in other open source and proprietary projects.
Example: http://docs.codehaus.org/display/SWIZZLE/Swizzle+Confluence
Library: http://repository.codehaus.org/org/codehaus/swizzle/swizzle-confluence/
Javadoc: http://swizzle.codehaus.org/swizzle-confluence/
Source: http://cvs.codehaus.org/viewrep/swizzle/trunk/swizzle-confluence/

Posted by dblevins at May 12, 2006 15:52
|
I'm trying to extend Confluence.pm to handle this and I can't get the sig to match. what should the last byte[] be passed as (in perl) I've tried a string and an array and get the following errors:
REMOTE ERROR: java.lang.NoSuchMethodException: $Proxy40.addAttachment(java.lang.String, java.lang.String, java.util.Hashtable, java.util.Vector)
And
REMOTE ERROR: java.lang.NoSuchMethodException: $Proxy40.addAttachment(java.lang.String, java.util.Hashtable, java.lang.String)
Any thoughts?

Posted by mwphoto at Jun 01, 2006 12:42
|
Has anyone successfully used the Metadata-Plugin api extension? From Perl?

Posted by jamesmortimer at Jun 04, 2006 01:24
|
Is it possible via remote API to set a list of users (or a single user or usergroup) to receive e-mail notifications for a specific page or space?
We would like people to automatically receive e-mails for the spaces/pages they should be tracking but without having everyone to set the notifications for themselves (error-prone, especially if we keep adding important spaces/pages they would have to do this every time).

Posted by steffenj at Jul 20, 2006 05:04
|
There seems to be a problem with the API as it does not seem to recognise the username if the username is a number.
I have created a user called anothertest using the API, then i assigned it to a group. All worked
I then created a user called 12345689, this worked, however when trying to allocate this to a group it return undef?
From within Confluence searching for the user 123456789 returned the correct user.
Any ideas?

Posted by vince.bhaura@bt.com at Jul 20, 2006 11:39
|
Hi Varindarpal,
Please open a support request at http://support.atlassian.com, and include the source code of the client you have written.
Thanks,
Tom

Posted by tom@atlassian.com at Jul 20, 2006 18:30
|
This isn't possible at present. You can add a feature request at http://jira.atlassian.com
The closest thing to what you want is to get each user to subscribe to an RSS feed for content with a particular label (e.g. their username), and to add the appropriate labels via the remote interface.

Posted by tom@atlassian.com at Jul 20, 2006 20:31
|
is there a way of getting all the users in a particular group?

Posted by vince.bhaura@bt.com at Aug 07, 2006 08:59
|
Hi Varindarpal,
Looking at the available remote API, User Management section, I do not see any possible way of doing so.
Could you please raise support request :
https://support.atlassian.com
Thanks,
Ivan

Posted by ivan@atlassian.com at Aug 08, 2006 01:11
|
Is it possible to change user login?

Posted by amitku@uiuc.edu at Aug 15, 2006 11:06
|
I'm not sure I understand the question. Could you explain exactly what you're trying to achieve?
You can log in as a different identity in the remote API just by calling the login method with a different username, and using the new token it returns.

Posted by cmiller at Aug 15, 2006 17:59
|
Hi, the hyperlink for "RemoteUser" doesn't go anywhere. Is RemoteUser deprecated, I'm having trouble using that object in a web service call. thanks, Bruce

Posted by bkrasnof at Aug 24, 2006 04:16
|
ignore that last question, that was dumb, I got my web service call working with RemoteUser, just couldn't pass anything in the constructor.

Posted by bkrasnof at Aug 24, 2006 05:06
|
Is there an XMLRPC interface to Export Page? (not Export Space)

Posted by davidjxyz at Sep 18, 2006 14:16
|
Hi David,
No there is no interface to export a page. This functionality is not directly supported in the UI either.
Thanks,
Iva

Posted by ivan@atlassian.com at Sep 18, 2006 18:11
|
You wrote: This functionality is not directly supported in the UI either.
Sure? What about the little icon Cannot resolve external resource into attachment. at the top right of the page? It does exactly that: exporting a page to PDF.
I'm currently looking for a possibility to export certain pages to PDF using an ant script or task. I failed to pass login information with a HTTP-request (I don't have cookies in ant). Jira supports login information passed as URL parameters: os_username and os_password but this seems not to work with Confluence.
Any ideas?

Posted by defa at Sep 28, 2006 12:06
|
Page storePage(String token, Page page) - add or update a page. For adding, the Page given as an argument should have space, title and content fields at a minimum. For updating, the Page given should have id, space, title, content and version fields at a minimum. The parentId field is always optional. All other fields will be ignored.
I need to programmatically add new pages and their revisions, and get the proper date and times (from the past) assigned to the updates. For example:
AddPage Foo "12-17-2005" Revision 1
AddPage Foo "1-15-2006" Revision 2
AddPage Foo "10-26-2006" Revision 3
Will this be possible, or will setting the date field when I call StorePage be ignored?

Posted by garnetr at Oct 27, 2006 18:27
|
hi,
is there a "getting started" guide for XML-RPC development?
thanks!

Posted by loetterle at Nov 01, 2006 05:58
|
I'm trying to find a way to either a) get the password of a user (for emails of type 'forgotten password'), or b) a function in either Confluence or JIRA to send the user his/hers credentials. I can't seem to find neither?

Posted by shelterit at Feb 19, 2007 00:17
|
Alexander: Passwords are hashed before they are store in Confluence. The only way to get a "forgotten password" email is to change the password with changeUserPassword to some known value and send them that in the mail.
Confluence's mail-sending API is not exposed in the Remote API. We didn't think it was necessary.

Posted by cmiller at Feb 19, 2007 00:37
|
Ok. Does my luck change if I say we manage our users in JIRA?

Posted by shelterit at Feb 19, 2007 03:05
|
I may add that the time of your server seems botched and in need of a shave.

Posted by shelterit at Feb 19, 2007 15:56
|
Need a way to only allow certain users, or certain groups of users, to use the API. We would like to manage our wiki through the API with the use of some external scripts, without throwing the API open to all our users. There are too many possibilities for unapproved users to accidentally do denial of service attacks using the API.

Posted by garnetr at Feb 19, 2007 18:11
|
We have getPagePermissions(Token, Page.id), but it seems that setPagePermissions has been forgotten from this list.... Is there some other way to set page level permissions from the API?

Posted by garnetr at Feb 19, 2007 19:01
|
Hi Alexander,
The passwords are also hashed in JIRA. Thus, it is still not possible.
Regards,
Mei

Posted by meiyan.chan@atlassian.com at Feb 21, 2007 01:16
|
Hi Alexander,
The time on the server seems accurate to me. Do you still see a problem with it? If so what? Is it an exact number of hours out? Have you set the timezone in your profile?

Posted by don.willis@atlassian.com at Feb 21, 2007 18:14
|
An improvement request has be filed for this already:
http://jira.atlassian.com/browse/CONF-3908
Please watch this issue to track its progress.
Cheers,
Dave

Posted by dave@atlassian.com at Feb 22, 2007 22:25
|
Please file this as an improvement or feature request at http://jira.atlassian.com.
If your users wanted to, they could DOS your site through the web not just through the remote API.
Cheers,
Dave

Posted by dave@atlassian.com at Feb 22, 2007 22:27
|
Notice that I'm more converned about a way to mail my users their credentials more than actually getting the password. I find it quite bizzarro that there is no such thing in neither API. Another problem is the lack of documentation for most of the remote function calls (Confluence); why are there no examples of anything? I'm having a hard time trying to work out how to set users permissions to spaces; not a single example. Has anyone done this?

Posted by shelterit at Feb 23, 2007 04:54
|
hello,
when i try to use this:
Confluence _confluence = new Confluence(_endpoint);
_confluence.login(_username, _password);
at runtime i became:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlrpc/XmlRpcClient
at org.codehaus.swizzle.confluence.Confluence.<init>(Confluence.java:33)
how can i fix this? i downloaded the apache xmlrpcclient, too, but no change.
plz help

Posted by maikvogel@gmx.net at Mar 07, 2007 06:03
|
have just fixed it myself
look at:
http://confluence.atlassian.com/display/JIRA/JIRA+Plugin+Development+Kit

Posted by maikvogel@gmx.net at Mar 07, 2007 06:17
|
addLabelByName(String token, String labelName, long objectId) seems to accept a labelName that contains a blank separated list of names and adds all of these. Not sure if this is the way it is suppose to happen or just an accident. Please clarify the documentation.

Posted by bob.swift@charter.net at Mar 20, 2007 21:50
|
|