Hi!
I'm trying to add users to our Confluence Cloud instance programmatically. The version appears to be 6.0.0-OD-2016.01.1-0002. Presumably current.
We're pretty heavy users of the REST API for on-premises JIRA instance, so the concepts are not entirely unfamiliar. In the latest documentation for Confluence REST API, there are no references to creating users. The only reference I can find for creating users is in the XML-RPC API documentation, which indicates it was deprecated since v5.5.
I was also told within the past month or so by Atlassian support that I should be able to use the JIRA REST API to manage users in Confluence Cloud. They even sent documentation references to the JIRA API.
So naturally I tried. Using Postman (in Chrome) or curl produces the same result: a 503 Service Temporarily Unavailable status and an HTML custom error page with the title "Atlassian Cloud Notifications - Page Unavailable".
It's a simple post, right? Authorization header, Base64 encoded, https to /rest/api/2/user, content-type JSON, and a body that contains something like this:
{
"name" : "Test",
"password" : "TestAccount123",
"emailAddress" : "fdfd@fdfd.com",
"displayName" : "Test Account",
}
All results are 503 and the custom error page as HTML.
Even a simple search or get returns the same.
curl.exe -D -u user@company.com -X GET -H "Content-Type: application/json" https://company.atlassian.net/rest/api/latest/user/search?username=user@company.com
So I suspect "Use the JIRA REST API" isn't the correct advice.
I have a functional bit of code using the XML-RPC API, but as the documentation indicates, it's deprecated. I'd prefer something with some long term support. Additionally, this method works "sometimes". I've had it work, and I've also had a few cases where it creates the accounts but leaves them in an unusable state that requires Atlassian support to go into the database and fix something up. Not exactly sure what they are doing, but I think they "sync" something. I'd be alright with this method in the short term if it were more reliable.
So I guess my question is:
Other than the deprecated XML-RPC API, which hasn't been the most reliable, is there a way to create users programmatically in Confluence Cloud?
Thx for your time!
Bryan
Community moderators have prevented the ability to post new answers.
Don't know if you figured this out, but by adding a user to the 'confluence-users' group via the API, you grant them access to Confluence. I have some sample Ruby code I could share, if you're still looking for a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, you are right. User management isnt available in the new confluence rest api. https://docs.atlassian.com/atlassian-confluence/REST/latest/.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you enabled the remote api? https://confluence.atlassian.com/doc/enabling-the-remote-api-150460.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.