Get groups using confluence API

Hi,

I am trying to create a developer app for Confluence cloud. I am getting the error ’ Unauthorized ’ when I try to call the get groups api. Heres the list of steps I followed -

  1. Create an app on developer.atlassian.com. Configure OAuth3.0 and configure confluence for it. Add ALL confluence scopes.

  2. Get the authorization code while being logged in to an org admin account (for a new test site I created on a free plan) and the access token

  3. Use the access token to get the site id

  4. Call the API to get groups - https://api.atlassian.com/ex/confluence//wiki/rest/api/group

Is there any step I am missing here?

  1. Assign some extra permissions to the app above?

  2. Publish the app on Developer Service Desk?

  3. Create a Connect app instead?

Ok, first there is a double slash in your url after “confluence” here : https://api.atlassian.com/ex/confluence//wiki/rest/api/group
Remove that…
And regarding permissions, this is defined for that route:
image
When I usually test things like this I give all permissions to myself so that does not bother me.
So check “confluence-user” permission.
image
And if everything is ok, you should be able to get response even from browser for that route.

I get this in browser:

{
    "results": [
        {
            "type": "group",
            "name": "administrators"

        },
        {
            "type": "group",
            "name": "confluence-users"

        }
    ],
    "start": 0,
    "limit": 200,
    "size": 9,
    "_links": {
        "base": "https://****.atlassian.net/wiki",
        "context": "/wiki",
        "self": "https://****.atlassian.net/wiki/rest/api/group"
    }
}

Hope it helps :wink:

Hi Mconabov,

Thanks for replying! The double slash was a typo :sweat_smile:

For apps I can see permissions are of the form of -

Read Confluence space summary(read:confluence-space.summary)
Read a summary of space information without expansions.

This I see when I develop my app on developer.atlassian.com - Confluence configuration

Have you built a Connect app here? It seems permissions look different here.

Also, I want to make a REST call only. I am assuming you are able to get the response on browser because the user is already logged in?