Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20029

REST API documentation for user management needs improvements

    XMLWordPrintable

Details

    • 0
    • 4
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition

      API Documentation for the user management REST APIs are not well documented.

      POST to /admin/groups, /admin/users, admin/groups/$groupname/add-users does not include an acceptable request representation or parameters so it's difficult to know which parameters need to be included. Example:

      Suggested Solution

      acceptable request representations:

      application/json (groups)

      {
           "name": "new_group"
      }
      

      application/json (users)

      {
           "name": "new_user",
           "fullName": "full name",
           "email": "user@atlassian.com",
           "password": "password",
           "passwordConfirm": "password"
      }
      

      application/json (add-users)

      ["user1","user2"]
      

      Workaround

      For a better idea on how to use these APIs, see the curl examples included below:

      curl --user bamboo-admin:password -H "Content-Type: application/json" -X POST http://bamboo:8085/rest/api/latest/admin/groups --data '{
           "name": "new_group"
       }'
      
      curl --user bamboo-admin:password -H "Content-Type: application/json" -X POST http://bamboo:8085/rest/api/latest/admin/users --data '{
           "name": "new_user",
           "fullName": "full name",
           "email": "user@atlassian.com",
           "password": "password",
           "passwordConfirm": "password"
       }'
      
      curl --user bamboo-admin:password -H "Content-Type: application/json" -X POST http://bamboo:8085/rest/api/latest/admin/groups/$GROUPNAME/add-user --data '["user1","user2"]'
      
      -- set group permission to given  project
      curl -k -u bamboo-admin:password \
           -H 'Content-type: application/json' \
           -H 'Accept: application/json' \
           -d '["READ","CREATE","ADMINISTRATION"]' \
           -X PUT http://bamboo:8085/rest/api/latest/permissions/project/$PROJECTKEY/groups/$GROUPNAME
      
      -- set global permissions for given group
      curl -k -u bamboo-admin:password \
           -H 'Content-type: application/json' \
           -H 'Accept: application/json' \
           -d '["READ","CREATE","ADMINISTRATION","RESTRICTEDADMINISTRATION","CREATEREPOSITORY"]' \
           -X PUT http://bamboo:8085/rest/api/latest/permissions/global/groups/$GROUPNAME
      

      Attachments

        Issue Links

          Activity

            People

              achystoprudov Alexey Chystoprudov
              jowen@atlassian.com Jeremy Owen
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: