I would like to be able to find out if a particular user is activated or disabled in Confluence via the REST API (or some other similar method). I can find how to get the details of users via the REST API (e.g. GET of http://example.com/rest/api/user?username=jblogs), but those details do not seem to return the status. Is there something I can use in the "expand" property perhaps?
If you have access to the database you can run a SQL query like:
select user_name, active from cwd_user where lower_user_name = 'admin';
The lower_user_name is the login username. The results should be something like this:
The T means the user is active.
Thanks for the response. This is what I ended up having to do, along with an HTTP to SQL connector in order to access it from another internal website.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How to get access to the database for confluence? I need to do it from EXCEL VBA - is that possible if the admin grants me the rights? Do I need to install something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What if we don't have access to the database to run queries? How can we find this user status information via API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I understand you can add &expand=status for example:
<Confluence_Base_URL>/rest/api/user?username=username&expand=status
Please let me know if this is what you are looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding &expand=status to the end of the query string does not return anything about the user status. In fact, it doesn't return anything different than using <Confluence_Base_URL>/rest/api/user?username=username. We are using Confluence version 6.0.7 if that matters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am sorry to hear that. I verified that &expand=status works with Confluence 6.5.1 and does not work on Confluence 6.0.7. Based on this, I don't think there is a way to get the user status using the REST API in Confluence 6.0.x.
Here is what was returned on 6.5.1:
{"type":"known","status":"deactivated","username":"charlie","userKey":"2c94a4c05ffe72d7015ffe742e860001","profilePicture":{"path":"/images/icons/profilepics/default.png","width":48,"height":48,"isDefault":true},"displayName":"Charlie","_links":{"base":"http://URL:8090","context":"","self":"http://URL:8090/rest/experimental/user?key=2c94a4c05ffe72d7015ffe742e860001"}}
Here is what I got on 6.0.7:
{"type":"known","username":"charlie","userKey":"2c94a4c05ffe56ac015ffe58f5eb0002","profilePicture":{"path":"/images/icons/profilepics/default.png","width":48,"height":48,"isDefault":true},"displayName":"Charlie of Atlassian","_links":{"base":"http://URL:8090","context":"","self":"http://URL:8090/rest/experimental/user?key=2c94a4c05ffe56ac015ffe58f5eb0002"}}
It looks like your options are to use the SQL queries or upgrade Confluence.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.