Skip to main content

Atlassian Crowd REST API

Note

This section assumes you are familiar with Atlassian Crowd, and have a Crowd server currently in use.

You can configure IQ Server to work with a Crowd server for the purposes of authenticating users and managing users and groups.

Creating/updating a Crowd Connection

To create/update a Crowd connection, aSystem Administratorcan issue a PUT request at the following endpoint:

PUT /api/v2/config/crowd

The PUT request must use the application/json content-type and must provide the connection data in the request body. The request body must contain the following fields:

serverUrl, that holds the Crowd Server URL.

applicationName, that holds the Crowd Application Name.

applicationPassword, that holds the Crowd Application Password.

Note: When updating you don't need to provide all fields, instead you can provide only the fields you want to update except when updating the server URL since that also requires the application password.

For example, using a local installation of IQ Server with its default configuration and assuming the Crowd server is also installed locally, a request using the cURL tool would be:

curl -u admin:admin123 -X PUT -H 'Content-Type: application/json' -d '{"serverUrl": "http://localhost:8095/crowd", "applicationName": "sonatype", "applicationPassword": "admin123"}' http://localhost:8070/api/v2/config/crowd

The successful HTTP response would be 204 No Content.

Getting Crowd Connection details

To get an existing Crowd connection, a System Administrator can issue a GET request at the following endpoint:

GET /api/v2/config/crowd

For example, using a local installation of IQ Server with its default configuration, a request using the cURL tool would be:

curl -u admin:admin123 http://localhost:8070/api/v2/config/crowd

The successful HTTP response would be 200 OK. The response looks like this:

{
    "serverUrl": "http://localhost:8095/crowd",
    "applicationName": "sonatype"
}

For security reasons, the password is not included as part of the response.

Removing a Crowd Connection

To remove an existing Crowd connection, a System Administrator can issue a DELETE request at the following endpoint:

DELETE /api/v2/config/crowd

Since you can only have one Crowd configuration in IQ Server, it is not necessary to provide information about the connection you want to delete.

For example, using a local installation of IQ Server with its default configuration , a request using the cURL tool would be:

curl -u admin:admin123 -X DELETE http://localhost:8070/api/v2/config/crowd

The successful HTTP response would be 204 No Content.

Testing a new or existing Crowd Connection

To test a Crowd Connection, a System Administrator can issue a POST request at the following endpoint:

POST /api/v2/config/crowd/test

For testing an existing connection, a request body is not required, otherwise the request body must contain the following fields:

serverUrl, that holds the Crowd Server URL.

applicationName, that holds the Crowd Application Name.

And theapplicationPassword, that holds the Crowd Application Password.

For example, using a local installation of IQ Server with its default configuration and assuming the Crowd server is also installed locally, a request using thecURLtool would be:

curl -u admin:admin123 -X POST -H 'Content-Type: application/json' -d '{"serverUrl": "http://localhost:8095/crowd", "applicationName": "sonatype", "applicationPassword": "admin123"}' http://localhost:8070/api/v2/config/crowd/test

For testing an existing connection, a request using the cURL would be:

curl -u admin:admin123 -X POST http://localhost:8070/api/v2/config/crowd/test

The successful HTTP response would be 200 OK. The response looks like this:

{"code":200,"message":null}