Where is the documentation on what the Confluence REST API returns?

I was able to get a user’s property, but I don’t understand how to decipher the JSON results. Please point me to the documentation that explains the values.

I read https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-user-properties/#api-wiki-rest-api-user-userid-property-key-get, but it doesn’t explain what any of the results mean.

{
    "results": [],
    "start": 0,
    "limit": 5,
    "size": 0,
    "_links": {
        "base": "https://xxxxxxxx.atlassian.net/wiki",
        "context": "/wiki"
    }
}

Not meant to be snarky, but the documentation of what the API returns is the result of the API call. A lot of our Typescript typings are based on what the output is of the request.

I’m just now learning about REST API and JSON. I don’t understand your reply; your snarkiness went over my head. I just want to know what start = 0 means, and what limit = 5 means. There must be documentation somewhere? What does this have to do with Typescript? I don’t know anything about Typescript. I ran the GET for both myself, a site admin, and for a non-admin user, and both returned the same thing.

Welcome to the Atlassian developer community @anon18754556,

The start and limit attributes are explained in the pagination section of the documentation here:
https://developer.atlassian.com/cloud/confluence/rest/v1/intro/#using

And generally, you can click through in the docs to see more details about the objects. For example, for the request you linked, click on the UserPropertyKeyArray:

Granted, in this case the attributes aren’t well documented. In which case, asking here, like you did is perfectly appropriate.

2 Likes

My apologies @anon18754556 , I did not fully parse your question. What I was referring to was that the documentation is not always clear (or lacking), indicating that you will have to infer the meaning of many of the responses yourself. That was what I was trying to convey.

Thanks ibuchanan. I had already read that page and clicked on the UserPropertyKeyArray. Neither explain what they are, what their values mean, etc.

I also looked at UserProperty value, which is the one that correlates with the GET command I executed; however, it too didn’t help my comprehension.

I think the results are saying that the array is empty because it didn’t find anything, that the limit = 5, which must be a default limit of how many it can return, and size = 0 because again the array is empty.

Below is the command I’m executing from Postman. I tried using curl, but was unsuccessful. Am I executing it correctly?

https://xxxxxxxx.atlassian.net/wiki/rest/api/user/60267c21d2766c00693faff0/property

No worries remie. I wasn’t offended…just stumped. :slight_smile: Due to my ignorance, I just don’t get it (the Confluence REST API).

Yes. The array is empty because it didn’t find anything.

If you are just getting started, then I suspect that’s not an “unsuccessful” result because you won’t have any user properties, if you didn’t set any. To learn more about user properties, see the general topic on Confluence entity properties. My guess is those aren’t what you think they are.

What were you hoping to find?

Well, what I really want is to:

  1. Bulk change users from having access to Confluence to turn off the Confluence flag, so the company doesn’t pay for inactive users.
  2. Bulk delete ex-employees from Access.
  3. Identify all groups that do not have identical permissions in all spaces.

For now, I’m just trying to figure out how to use the Confluence REST API.

image

I discovered the Forge tutorial, and am looking into using it to do what we need.

Thanks!

@anon18754556,

Those are reasonable use cases. Unfortunately, the first 2 are probably a better fit for the Atlassian Cloud Admin APIs. And doubly unfortunate is that Forge doesn’t work with those APIs.

The trick to the first use case is understanding that isn’t a user property but is determined by membership in a group. Remove a user from the right group, and they won’t be able to login to Confluence, which removes them from the licensing pool. The docs refer to that special group as a default group. Scroll down on the following, and you’ll find the group should be called confluence-users-<sitename>.

Fortunately, you can leverage your Forge learning against the last use case. For that, you’ll probably want to check content permissions.

Thank you ibuchanan! I’ll look into all that. Due to other tasks, this will probably take me a few days if not longer.

I received the following from Atlassian Cloud Support stating that tasks 1 and 2, which I defined above in a prior post, cannot be done because there is no provided option. See the response below:

Fernando S commented:

I do have tough news to share with you on that regard. There’s currently no publicly available endpoint to start managed Atlassian accounts deletion, yet.

We do have a feature request to expose the functionality, and I do see there is active development going on - ID-7635: REST API to bulk delete managed accounts, but I don’t have any ETA to share with you. I mentioned your ticket as a internal comment on the feature request and you can also help with traction by leaving any feedback, vote for the feature or watch it for news.

At this feature request thread there is a comment from Alex M, it seems to be a homebrew script so it is unsupported, but it may be worth to check.

This being said, the Jira endpoint is a known workaround to the matter, but it only removes the account from Jira. It does not remove the Atlassian Account, in case you’re aiming to reduce your Atlassian Account count, this won’t help. It also requires that the user was never mentioned on Jira, so it has a limited use case.

Removing/Adding site access is also in development and this is not publicly available yet. This is the feature request that is being used to track the efforts for that - ID-7711: REST API to activate/deactivate users, I also mentioned your support ticket as a internal comment on this one.

To be eligible for this feature we will need to convert your Atlassian Organization to a revised user management experience, suspending/activating site access is only available at the revised user management experience, you’re currently in the legacy one.

To have this in place we will need to create or migrate a single site to your Atlassian Organization. It can be a dummy or test site, the contents of the site does not matter, but we need one created to proceed with internal processes that needs to be updated on the organization.

If you’re interested in proceeding I can share more details, just let me know with your confirmation. Also note that this API is fully experimental.


It is a lot of information, I know. So take your time to review it all and let me know in case of any concerns or doubts.
Do you have a consolidated list with users you want marked for deletion and/or removed from your site? Would it be possible to generate one in case you don’t have it?


Fernando S. - Atlassian Cloud Support - Access