[ARA] Rest Api - Adding users to a user group

book

Article ID: 129878

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Using ARA/CDA REST API to add an user to an usergroup
When following the example on API documentation to add user into an usergroup, the new user is added but the old users are deleted.
 
http://{{hostname}}/ara/api/data/v1/usergroups/:id/users 
{ 
"$schema": "http://domain:port/ara/api/data/v1/schemas/AssignUsersCommand_Parameter.json",
"users": ["2000/RVJ2FE/DE"] 
}


 

Environment

Release:
Component: ARLSMG

Resolution

Actually there are 2 different uses
  • Method 1: Appending array of users
    • By using: "users": ["client/user/department"] you are replacing the entire content of that usergroup with this 'array'.
    • So the correct use for this method is:
"users": ["client/user/department","client2/user2/department2",...]
  • Method 2: Adding 1 object
    • By using: "users": {"name":"client/name/department"} you are adding this user to the usergroup (means adding an 'object')
    • So this means if you want to add user to user group instead of replacing them, you should use this method
"users": {"name":"client/name/department"}