REST Api Extender for Confluence

 

About plugin

Plugin add ability to manage groups in Confluence using new REST API.

  • add groups
  • remove groups
  • get all groups
  • add users into group
  • remove users from group
  • get users list from group

 

Download Add-on from Atlassian Marketplace – REST Api Extender for Confluence

 

 

Configuration

Plugin don’t have any graphic configuration, gives only REST API endpoint.

 

Manage groups

Get Confluence group users

  GET available for all confluence users

{CONFLUENCE_URL}/rest/extender/1.0/group/getUsers/{GROUP}

where {GROUP} group name in Confluence.

Request example:

{CONFLUENCE_URL}/rest/extender/1.0/group/getUsers/confluence-users

Response example:

{
  "users":[
    {"admin":"Administrator"},
    {"user1":"Full Name user1"},
    {"user2":"Full Name user2"},
    {"user3":"Full Name user3"}
  ],
  "status":"success"
}

 

Get Confluence groups – since v. 1.1.1

  GET available for all confluence users

{CONFLUENCE_URL}/rest/extender/1.0/group/getGroups

Response example:

{
  "groups": ["confluence-administrators","confluence-users"],
  "message":"",
  "status":"success"
}

 

Add groups to Confluence

  Available for confluence administrators

{CONFLUENCE_URL}/rest/extender/1.0/group/addGroups

JSON POST body for request

  • POST example for one group
  • POST example for several groups

{
  "groups": [
    "group1"
  ]
}

{
  "groups": [
    "group1",
    "group2"
  ]
}


Example response
  • Example 1
  • Example 2

{
  "groupsAdded": [
    "group1"
  ],
  "groupsSkipped": [],
  "message": "all groups added",
  "status": "success"
}

{
  "groupsAdded": [
    "group2"
  ],
  "groupsSkipped": [
    "group1"
  ],
  "message": "groups added, some groups skipped",
  "status": "success"
}

 

Remove groups to Confluence

  Available for confluence administrators

{CONFLUENCE_URL}/rest/extender/1.0/group/removeGroups

JSON POST body for request

  • POST example for one group
  • POST example for several groups

{
  "groups": [
    "group1"
  ]
}

{
  "groups": [
    "group1",
    "group2"
  ]
}


Example response
  • Example 1
  • Example 2

{
  "groupsRemoved": [
    "group1"
  ],
  "groupsSkipped": [],
  "message": "all groups removed",
  "status": "success"
}

{
  "groupsRemoved": [
    "group2"
  ],
  "groupsSkipped": [
    "group1"
  ],
  "message": "groups removed, some groups skipped",
  "status": "success"
}

 

Manage users in groups

Add users to Confluence group

  Available for confluence administrators

{CONFLUENCE_URL}/rest/extender/1.0/group/addUsers/{GROUP}

where {GROUP} group name in Confluence.

Request example:

{CONFLUENCE_URL}/rest/extender/1.0/group/addUsers/confluence-users

JSON POST body for request

  • POST example for one user
  • POST example for several users

{
  "users": [
    "user1"
  ]
}

{
  "users": [
    "user1",
    "user2"
  ]
}


Example response
  • Example 1
  • Example 2

{
  "usersAdded": [
    "user1"
  ],
  "usersSkipped": [],
  "message": "all users added to group",
  "status": "success"
}

{
  "usersAdded": [
    "user2"
  ],
  "usersSkipped": [
    "user1"
  ],
  "message": "users added to group, but some users skipped",
  "status": "success"
}

 

Remove users from Confluence group

  Available for confluence administrators

{CONFLUENCE_URL}/rest/extender/1.0/group/removeUsers/{GROUP}

where {GROUP} group name in Confluence.

Request example:

{CONFLUENCE_URL}/rest/extender/1.0/group/removeUsers/confluence-users

JSON POST body for request

  • POST example for one user
  • POST example for several users

{
  "users": [
    "user1"
  ]
}

{
  "users": [
    "user1",
    "user2"
  ]
}


Example response
  • Example 1
  • Example 2

{
  "usersRemoved": [
    "user1"
  ],
  "usersSkipped": [],
  "message": "all users removed from group",
  "status": "success"
}

{
  "usersRemoved": [
    "user2"
  ],
  "usersSkipped": [
    "user1"
  ],
  "message": "users removed from group, but some users skipped",
  "status": "success"
}

 

Installation

Read official Atlassian documentation about installing add-ons in JIRA “Atlassian – Installing add-ons

Support

If you have any questions or suggestions please don’t hesitate to contact me.

Please feel free to contact by support@itlab.net.pl, if you require any further information.