Update Groups
Updates the groups (only EPM) provided in the REST API payload. Additionally, with this API, groups can also be updated with users or group members.
This version contains all parameters in the payload and does not require URL encoding while calling the REST APIs.
The API is synchronous and returns the outcome of the operation in the response. Any non-zero status indicates that Updating Groups failed. With this API, you can see which records failed and the reason why they failed, in addition to how many records passed and failed.
This API is version v1.
Required Roles
Service Administrator
Any predefined role and the Access Control - Manage application role
REST Resource
PUT /interop/rest/security/v1/groups/update
Note:
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for Cloud EPM REST APIs. Using this REST API requires prerequisites. See Prerequisites.
Request
Supported Media Types: application/json
Table 12-66 Request Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
groups |
List of groups to update | Payload | Yes | None |
groupname |
Name of groups to update | Payload | No | None |
description |
Description of the group | Payload | No | None |
type |
Type of group to update Note: For now, only "EPM" is supported. |
Payload | Yes | None |
identity |
Identity of the group to update | Payload | Yes | None |
members |
List of users or groups to assign as member of this group
|
Payload | No | None |
Example URL and Payload
https://<BASE-URL>/interop/rest/security/v1/groups/update
{
"groups": [
{
"groupname": "GroupA",
"description": "GroupADescription_updated",
"type": "EPM",
"identity": "native://nvid=7afc645a6c46bb19:39236dfe:17f68cb24d0:-7fbe?GROUP",
"members": {
"users": [
{
"userlogin": "jdoe"
},
{
"userlogin": "chris"
}
],
"groups": [
{
"groupname": "User"
},
{
"groupname": "Interactive User"
}
]
}
},
{
"groupname": "GroupB",
"description": "GroupBDescription_updated",
"type": "EPM",
"identity": "native://nvid=7afc645a6c46bb19:39236dfe:17f68cb24d0:-7fbf?GROUP",
"members": {
"users": [
{
"userlogin": "jane"
},
{
"userlogin": "alex"
}
],
"groups": [
{
"groupname": "Analyst"
},
{
"groupname": "Super User"
}
]
}
}
]
}
Response
Supported Media Types: application/json
Table 12-67 Response Parameters
| Name | Description |
|---|---|
links |
Detailed information about the link and HTTP call type |
status |
Identifies the status of the operation
|
error |
Detailed information about the error |
details |
Detailed status of the operation performed. Total number of records processed, succeeded, and failed, and the reason for why they failed. |
Examples of Response Body
The following examples show the contents of the response body in JSON format:
Example 1: REST API Completes without Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v1/groups/update",
"action": "PUT"
},
"status": 0,
"error": null,
"details": {
"processed": 2,
"succeeded": 2,
"failed": 0,
"faileditems": null
}
}
Example 2: REST API Completes with Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v1/groups/update",
"action": "PUT"
},
"status": 1,
"error": {
"errorcode": "EPMCSS-21192",
"errormessage": "Failed to update Groups. Authorization failed. Please provide valid authorized user."
},
"details": null
}
Example 3: REST API Completes with Partial Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v1/groups/update",
"action": "PUT"
},
"status": 0,
"error": null,
"details": {
"processed": 3,
"succeeded": 1,
"failed": 2,
"faileditems": [
{
"groupname": "GroupA",
"errorcode": "EPMCSS-21140",
"errormessage": "Failed to update group. Group already exists in System. Provide different group name."
},
{
"groupname": "GroupB",
"errorcode": "EPMCSS-21231",
"errormessage": "Failed to update group. Unable to assign member(s). Provide valid member(s).",
"erroritems": {
"groups": [
{
"groupname": "GroupC",
"errorcode": "EPMCSS-21228",
"errormessage": "Group GroupC does not exist. Provide a valid groupname."
}
],
"users": [
{
"userlogin": "UserA",
"errorcode": "EPMCSS-21230",
"errormessage": "User UserA does not exist. Provide a valid userlogin."
}
]
}
}
],
"items": null
}
Sample cURL Command Basic Auth
curl -X PUT -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json' -d '{"groups":[{"groupname":"GroupA","description":"GroupADescription_updated","type":"EPM","identity":"native://nvid=7afc645a6c46bb19:39236dfe:17f68cb24d0:-7fbe?GROUP",}]}' 'https://<BASE-URL>/interop/rest/security/v1/groups/update'
curl -X PUT -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json' -d '{"groups":[{"groupname":"GroupA","description":"GroupADescription_updated","type":"EPM","identity":"native://nvid=7afc645a6c46bb19:39236dfe:17f68cb24d0:-7fbe?GROUP","members":{"users":[{"userlogin":"jdoe"},{"userlogin":"chris"}],"groups":[{"groupname":"User"},{"groupname":"Interactive User"}]}}]}' 'https://<BASE-URL>/interop/rest/security/v1/groups/update'
Sample cURL Command OAuth 2.0
curl -X PUT --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H'Content-Type: application/json' -d '{"groups":[{"groupname":"GroupA","description":"GroupADescription_updated","type":"EPM","identity":"native://nvid=7afc645a6c46bb19:39236dfe:17f68cb24d0:-7fbe?GROUP"}]}' 'https://<BASE-URL>/interop/rest/security/v1/groups/update'
curl -X PUT --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H'Content-Type: application/json' -d '{"groups":[{"groupname":"GroupA","description":"GroupADescription_updated","type":"EPM","identity":"native://nvid=7afc645a6c46bb19:39236dfe:17f68cb24d0:-7fbe?GROUP","members":{"users":[{"userlogin":"jdoe"},{"userlogin":"chris"}],"groups":[{"groupname":"User"},{"groupname":"Interactive User"}]}}]}' 'https://<BASE-URL>/interop/rest/security/v1/groups/update'