How to expand application roles including confluence-access using rest-api

Fayaz Abdul June 13, 2019

Hello team,

When i follow this rest-api link

 https://xyz-solutions.atlassian.net/rest/api/3/user?username=reaz.abdul&expand=applicationRoles

It's showing only jira-service-desk and jira-software as below but not confluence, please refer attachment.

0 
key"jira-servicedesk"
name"Jira Service Desk"
1 
key"jira-software"
name"JIRA Software"
expand"groups,applicationRoles"

Please let me know how to get confluence access also using rest-api.

Thanks in advance

Fayaz

image.png

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2019

HI Fayaz,

I see you are looking to be able to grant Atlassian Cloud users access to use Confluence Cloud via the REST API.  The Jira REST API endpoint you referenced there can show you a users' application roles.  But those application roles are specific to Jira Applications (which only include Jira Core, Jira Software, Jira Service Desk).  It technically is not designed to show you if the user has Confluence access or not.

That said, Product access is still governed by user's group memberships.  By default in Atlassian Cloud, any users that are members of the confluence-users group will have access to Confluence.  It's possible that there are other groups that grant access, OR that this group name has been altered.  The best way to confirm that group name in your site is to visit the admin.atlassian.com site and click the Product access link to see these group(s) that grant access for that product.  More details on this in Update product access settings.

You can then use the Jira REST API endpoint of Add user to group -- POST /rest/api/3/group/user.  That endpoint will let you add users to a group, in most cases adding that user to the confluence-users group will grant them product access.

Or if you're just looking to find which users have product access via REST, you could use the endpoint Get users from group -- GET /rest/api/3/group/member.  You would just need to repeat this call for each group that grants access to Confluence to get a complete list of which users can access this.

I hope this helps.

Andy

Suggest an answer

Log in or Sign up to answer