Rest/api/space/qywh?expand=permissions

not return permissions infomation, why?

Can you please provide us with some more information?

Which version of Confluence are you developing against?
Server or Cloud?

What are you expecting to receive?

If you cannot provide us with more information it’s impossible for the community to provide you with decent help.

Confluence  are 6.4.1
 Confluence Server, not cloud

I want to receiver permissions of space, and use resutapi set permissions

I’m using Atlassian Confluence REST API. I need to get Space permissions. I couldn’t find it on documentations. Who used this REST APIs? How to get it?

I expecting to receive result as follow:

[
{
“type”: “SETSPACEPERMISSIONS”,
“spacePermissions”: [
{
“type”: “SETSPACEPERMISSIONS”,
“userName”: null,
“groupName”: “confluence-administrators”
}
]
},
{
“type”: “EXPORTSPACE”,
“spacePermissions”: [
{
“type”: “EXPORTSPACE”,
“userName”: null,
“groupName”: null
},
{
“type”: “EXPORTSPACE”,
“userName”: null,
“groupName”: “confluence-users”
},

I just tested this with the latest version of Confluence Server and permissions is not an option to expand for Confluence Server.

You can check the available options by calling api/space/ and look at the expandable options.

This is what I got:

{
"id":98306,
"key":"TEST",
"name":"Test",
"type":"global",
"_links":
 {
  "webui":"/display/TEST",
  "collection":"/rest/api/space",
  "base":"http://localhost:8090",
  "context":"",
  "self":"http://localhost:8090/rest/api/space/TEST"},
  "_expandable":
  {
   "metadata":"",
   "icon":"",
   "description":"",
   "homepage":"/rest/api/content/65576"
  }
 }

So you can only use expand with the following properties:

  • metadata
  • icon
  • description
  • homepage

Please tell me how to get permissions of space?
It is important for my company, thx.

It’s not possible through the Rest API but you should be able to get them through the Java API.
But that will require you to write a P2 plugin for your Server instance.

can you give me a demo?

I use “Bitbucket” example, but i don’t access .

I user " atlas-run" cmd start this example,

http://localhost:51218/manager/rest/myrestresource/1.0/message not found

Where does “manager” come from? Shouldnt it be “confluence”?

I installed plug " Home · ttorvela/space-permissions-handler Wiki · GitHub ",
but not access, url is : http://wiki.ele.to:8090/confluence/rest/userpermissions/1.0/admin

First of all, the space-permissions-handler plugin should require admin permissions to poke that rest endpoint. If not, remove it immediately. Thus, we can’t access the url as we dont have admin status.
Secondly, I uploaded your github project to my dev and works absolutely fine:

<message key="default">
<value>Hello World</value>
</message>

which further means you are calling the rest endpoint wrongly.

my dev and works too, but add-ones to service, not access.
is space-permissions-handler plugin is not compatibility conflunce 6.4.1 ?

Sorry i dont understand.

I also can be normal operation and visit here, but installed on the server can not visit。
Is it because the version is not compatible?

This is an old thread, but what about the following Python script:
NOTE: it doesn’t give you detailed information
import requests
import json
from atlassian import Confluence

Change the following:

confluence_url = ‘https://xxx.atlassian.net/
username = ‘user@company.com’
password = ‘API token’

Atlassian account

#########################
confluence = Confluence(url=confluence_url,username=username,password=password,cloud=True)
spaces = confluence.get_all_spaces(start=0, limit=500, expand=None)
for space in spaces[“results”]:
url = confluence_url+“/wiki/rest/api/space/”+space[“key”]+“?expand=permissions”
response = requests.get(url, auth=(username, password)).json()
for permission in response[“permissions”]:
if “user” in permission[“subjects”]:
data = permission[“subjects”][“user”]
name = “publicName”
else:
data = permission[“subjects”][“group”]
name = “name”
results = data[“results”]
for result in results:
print(space[“key”] + " - " +result[name])