List of admins of a defined space in Confluence Server REST API

Hi Guys,

I need to get the list of admins of a defined space in Confluence Server REST API.
I was using https://myServer/confluence/rpc/json-rpc/confluenceservice-v2/getSpacePermissionSets, but, it seems that it was deprecated.
Can you please give me the alternative API of it?

Many thanks,
Rosy

2 Likes

Hi @rosy.salame,

I believe there’s no REST API specifically for that purpose. However, you might want to check the Java route described in this documentation.

Cheers,
Ian

1 Like

Hello @ianRagudo,

There is an API to fetch spaces’s property which can be found using the following here:
GET /wiki/rest/api/space/{spaceKey}/property/{key}

This yields a list of users in the permissions attribute which we are looking for as shown by an example:

{
  "id": 2154,
  "key": "<string>",
  "value": {},
  "version": {
    "when": "<string>",
    "message": "<string>",
    "number": 2154,
    "minorEdit": true
  },
  "space": {
    "id": 2154,
    "key": "<string>",
    "name": "<string>",
    "icon": {
      "path": "<string>",
      "width": 2154,
      "height": 2154,
      "isDefault": true
    },
    "description": {
      "plain": {
        "value": "<string>",
        "representation": "plain",
        "embeddedContent": [
          {}
        ]
      },
      "view": {
        "value": "<string>",
        "representation": "plain",
        "embeddedContent": [
          {}
        ]
      }
    },
    "homepage": {
      "id": "<string>",
      "type": "<string>",
      "status": "<string>",
      "title": "<string>",
      "history": {
        "latest": true,
        "createdBy": {
          "type": "known",
          "username": "<string>",
          "userKey": "<string>",
          "accountId": "<string>",
          "profilePicture": {
            "path": "<string>",
            "width": 2154,
            "height": 2154,
            "isDefault": true
          },
          "displayName": "<string>",
          "_expandable": {},
          "_links": {}
        },
        "createdDate": "<string>"
      },
      "version": {
        "by": {
          "type": "known",
          "username": "<string>",
          "userKey": "<string>",
          "accountId": "<string>",
          "profilePicture": {
            "path": "<string>",
            "width": 2154,
            "height": 2154,
            "isDefault": true
          },
          "displayName": "<string>",
          "_expandable": {},
          "_links": {}
        },
        "when": "<string>",
        "friendlyWhen": "<string>",
        "message": "<string>",
        "number": 2154,
        "minorEdit": true,
        "_expandable": {
          "content": "<string>",
          "collaborators": "<string>"
        },
        "_links": {}
      },
      "ancestors": [],
      "operations": [
        {
          "operation": "administer",
          "targetType": "page"
        }
      ],
      "children": {
        "_expandable": {},
        "_links": {}
      },
      "childTypes": {
        "_expandable": {}
      },
      "descendants": {
        "_expandable": {},
        "_links": {}
      },
      "container": {},
      "body": {
        "view": {
          "value": "<string>",
          "representation": "view",
          "_expandable": {}
        },
        "export_view": {
          "value": "<string>",
          "representation": "view",
          "_expandable": {}
        },
        "styled_view": {
          "value": "<string>",
          "representation": "view",
          "_expandable": {}
        },
        "storage": {
          "value": "<string>",
          "representation": "view",
          "_expandable": {}
        },
        "editor2": {
          "value": "<string>",
          "representation": "view",
          "_expandable": {}
        },
        "anonymous_export_view": {
          "value": "<string>",
          "representation": "view",
          "_expandable": {}
        },
        "_expandable": {
          "editor": "<string>",
          "view": "<string>",
          "export_view": "<string>",
          "styled_view": "<string>",
          "storage": "<string>",
          "editor2": "<string>",
          "anonymous_export_view": "<string>"
        }
      },
      "restrictions": {
        "read": {
          "operation": "administer",
          "_expandable": {},
          "_links": {}
        },
        "update": {
          "operation": "administer",
          "_expandable": {},
          "_links": {}
        },
        "_links": {}
      },
      "_expandable": {
        "childTypes": "<string>",
        "container": "<string>",
        "metadata": "<string>",
        "operations": "<string>",
        "children": "<string>",
        "restrictions": "<string>",
        "history": "<string>",
        "ancestors": "<string>",
        "body": "<string>",
        "version": "<string>",
        "descendants": "<string>",
        "space": "<string>"
      },
      "_links": {}
    },
    "type": "<string>",
    "metadata": {
      "labels": {
        "results": [
          {
            "prefix": "<string>",
            "name": "<string>",
            "id": "<string>",
            "label": "<string>"
          }
        ],
        "start": 2154,
        "limit": 2154,
        "size": 2154,
        "_links": {}
      }
    },
    "operations": [
      {
        "operation": "administer",
        "targetType": "page"
      }
    ],
    "permissions": [
      {
        "subjects": {
           "user": {
             "results": [
               {
                 "type": "known",
                 "username": "<string>",
                 "userKey": "<string>",
                 "accountId": "<string>",
                 "profilePicture": {
                   "path": "<string>",
                   "width": 2154,
                   "height": 2154,
                   "isDefault": true
                 },
                 "displayName": "<string>",
                 "_expandable": {},
                 "_links": {}
               }
             ],
            "size": 2154
          },
          "group": {
            "results": [
              {
                "type": "group",
                "name": "<string>",
                "_links": {}
              }
            ],
            "size": 2154
          },
          "_expandable": {
            "user": "<string>",
            "group": "<string>"
          }
        },
        "operation": {
          "operation": "administer",
          "targetType": "page"
        },
        "anonymousAccess": true,
        "unlicensedAccess": true
      }
    ],
    "status": "<string>",
    "settings": {
      "routeOverrideEnabled": true,
      "_links": {}
    },
    "theme": {
      "themeKey": "<string>",
      "name": "<string>",
      "description": "<string>",
      "icon": {
        "path": "<string>",
        "width": 2154,
        "height": 2154,
        "isDefault": true
      },
      "_links": {}
    },
    "lookAndFeel": {
      "headings": {
        "color": "<string>"
      },
      "links": {
        "color": "<string>"
      },
      "menus": {
        "hoverOrFocus": {
          "backgroundColor": "<string>"
        },
        "color": "<string>"
      },
      "header": {
        "backgroundColor": "<string>",
        "button": {
          "backgroundColor": "<string>",
          "color": "<string>"
        },
        "primaryNavigation": {
          "color": "<string>",
          "hoverOrFocus": {
            "backgroundColor": "<string>",
            "color": "<string>"
          }
        },
        "secondaryNavigation": {
          "color": "<string>",
          "hoverOrFocus": {
            "backgroundColor": "<string>",
            "color": "<string>"
          }
        },
        "search": {
          "backgroundColor": "<string>",
          "color": "<string>"
        }
      },
      "content": {
        "screen": {
          "background": "<string>",
          "backgroundColor": "<string>",
          "backgroundImage": "<string>",
          "backgroundSize": "<string>",
          "gutterTop": "<string>",
          "gutterRight": "<string>",
          "gutterBottom": "<string>",
          "gutterLeft": "<string>"
        },
        "container": {
          "background": "<string>",
          "backgroundColor": "<string>",
          "backgroundImage": "<string>",
          "backgroundSize": "<string>",
          "padding": "<string>",
          "borderRadius": "<string>"
        },
        "header": {
          "background": "<string>",
          "backgroundColor": "<string>",
          "backgroundImage": "<string>",
          "backgroundSize": "<string>",
          "padding": "<string>",
          "borderRadius": "<string>"
        },
        "body": {
          "background": "<string>",
          "backgroundColor": "<string>",
          "backgroundImage": "<string>",
          "backgroundSize": "<string>",
          "padding": "<string>",
          "borderRadius": "<string>"
        }
      },
      "bordersAndDividers": {
        "color": "<string>"
      }
    },
    "history": {
      "createdDate": "<string>"
    },
    "_expandable": {
      "settings": "<string>",
      "metadata": "<string>",
      "operations": "<string>",
      "lookAndFeel": "<string>",
      "permissions": "<string>",
      "icon": "<string>",
      "description": "<string>",
      "theme": "<string>",
      "history": "<string>",
      "homepage": "<string>"
    },
    "_links": {}
  },
  "_expandable": {
    "version": "<string>",
    "space": "<string>"
  }
}

I was wondering if you can help here. We are using the server and not the cloud version of Confluence and as such the equivalent API can be found here which I think should yield the same result. Unfortunately, it is not yielding any result and is sort of misleading because they illustrate 2 URLs were one of them is working and the other is not.

  • GET /rest/experimental/space/TST/property?expand=space,version (Not Working)
  • GET /rest/space/{spaceKey}/property/{key} (Working)

Regards,
Mohamad

2 Likes

@muhamed.yassine I have the same problem as you. Did you happen to find a solution at all?

1 Like