Remove Groups (v1)

Removes groups listed in an ANSI or UTF-8 encoded CSV file maintained in Access Control. You can use the Upload REST API to upload the file to the environment. The file format is as follows:

Group Name
GroupA
GroupB

The user running this API must be authorized to perform this action. This API should be run only by a service administrator in the environment where a group is to be removed.

The presence of status -1 in the response indicates that the removal in progress. Use the job status URI to determine whether the removal is complete. Any non-zero status except -1 indicates failure. With this API, you can see which records failed and the reason why they failed in addition to how many records passed and failed.

Required Roles

Service Administrator or any predefined role and the Access Control - Manage granular role

REST Resource

DELETE /interop/rest/security/<api_version>/groups

Table 13-68 Tasks for Remove Groups

Task Request REST Resource
Remove groups DELETE /interop/rest/security/v1/groups
Remove groups status GET /interop/rest/security/v1/jobs/<jobId>

Request

Supported Media Types: application/x-www-form-urlencoded

Table 13-69 Parameters

Name Description Type Required Default
filename

The name of the uploaded ANSI or UTF-8 encoded CSV file containing information on the groups to be removed, for example, removeGroups.csv.

The file must have been uploaded already using the Upload REST API.

Group Name
GroupA
GroupB
Query Yes None

Response

Supported Media Types: application/json

Table 13-70 Parameters

Name Description
details In the case of errors, details are published with the error string
status See Migration Status Codes
links Detailed information about the link
href Links to API call or status API
action The HTTP call type
rel Possible values: self or Job Status. If the value is set to Job Status, you can use the href to get the status
data Parameters as key value pairs passed in the request
items Details about the resource
links Details of the first URL to be requested to get the job details; rel is "Job Details"

Examples of Resonse Body

Example 1: Job is in Progress

{
    "status": -1,
    "items": null,
    "links": [
        {
            "href": "https://<BASE-URL>/interop/rest/security/<api_version>/groups?filename=<filename>",
            "rel": "self",
            "data": {
                "jobType": "REMOVE_GROUPS",
                "filename": "<filename>"
            },
            "action": "DELETE"
        },
        {
            "href": "https://<BASE-URL>/interop/rest/security/<api_version>/jobs/<jobId>",
            "rel": "Job Status",
            "data": null,
            "action": "GET"
        }
    ],
    "details": null
}

Example 2: Job Completes with Errors

{
    "links": [
        {
            "href": "https://<BASE-URL>/interop/rest/security/<api_version>/groups",
            "rel": "self",
            "data": {
                "jobType": "REMOVE_GROUPS",
                "filename": ""
            },
            "action": "DELETE"
        }
    ],
    "status": 1,
    "details": "EPMCSS-20673: Failed to delete groups. Invalid or insufficient parameters specified. Provide all required parameters for the REST API. ",
    "items": null
}

Example 3: Job Completes without Errors

{
    "links": [
        {
            "data": null,
            "action": "GET",
            "href": "https://<BASE-URL>/interop/rest/security/<api_version>/jobs/<jobId>",
            "rel": "self"
        }
    ],
    "status": 0,
    "details": "Processed - 3, Succeeded – 2, Failed - 1.   ",
    "items":  [
    {
		"GroupName":"<GROUPNAME>","Error_Details": "Group <GROUPNAME> is not found. Verify that the group exists."
     }
   ]
}

Sample cURL Command Basic Auth

curl -X DELETE -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/x-www-form-urlencoded' 'https://<BASE-URL>/interop/rest/security/v1/groups?filename=RemoveGroups.csv'

Sample cURL Command OAuth 2.0

curl -X DELETE --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H 'Content-Type: application/x-www-form-urlencoded' 'https://<BASE-URL>/interop/rest/security/v1/groups?filename=RemoveGroups.csv'