Fetch All Resource Groups of a User

GET

This API retrieves all resource groups associated with the user. The response includes the list of groups and the associated details.

Request URL

https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resourcegroup

Header Parameters

{
"AUTHTOKEN" : "<<Authtoken-generated-from-PAM360>>",
"orgName"   : "<<org display name>>"
}

ParameterDescriptionValues

AUTHTOKEN

Authentication token for the user to authorize the API request.
Type : String
Mandatory : Yes

Default Value : N/A

orgName

Organization name available in PAM360.
Type : String
Mandatory : No

Default Value : The organization to which the user belongs.

Query Parameters

INPUT_DATA = {
"operation": {
	"details": {
		"limit": "3",
		"startIndex": "1",
		"searchType": "static",
		"searchValue": "sample",
		"searchColumn": "resourceGroupName"
		}
	}
}

ParametersDescriptionValues

limit

The maximum number of records to be retrieved.
Type : Integer
Mandatory : No

Default Value : N/A

startIndex

The index from which the result set should begin.
Type : Integer
Mandatory : No

Default Value : N/A

searchType

Defines the category on which the search should be performed.
Type : String
Mandatory : No

Default Value : N/A
Allowed Values : static, dynamic, all

searchValue

The keyword used for the search.
Type : String
Mandatory : No

Default Value : N/A

searchColumn

Specifies the columns where the search should be applied.
Type : String
Mandatory : No

Default Value : N/A
Allowed Values : resourceGroupName, resourceGroupDescription, ownerId, all

Sample Request

cURLPythonPowerShell
curl -G -X GET "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resourcegroup" -H "AUTHTOKEN: <<Authtoken-generated-from-PAM360>>" -H "Content-Type: application/x-www-form-urlencoded" --data-urlencode "INPUT_DATA={\"operation\":{\"details\":{\"limit\":3,\"startIndex\":4,\"searchType\":\"all\",\"searchValue\":\"sample\",\"searchColumn\":\"all\"}}}"
import requests
import json

# API endpoint
url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resourcegroup"

# Headers
headers = {
	"AUTHTOKEN": "<<Authtoken-generated-from-PAM360>>",
	"Content-Type": "application/x-www-form-urlencoded"
}

# Payload to be sent as query parameter
payload = {
	"operation": {
		"details": {
			"limit": 3,
			"startIndex": 4,
			"searchType": "all",
			"searchValue": "sample",
			"searchColumn": "all"
		}
	}
}

# Wrap JSON payload in INPUT_DATA
params = {
	"INPUT_DATA": json.dumps(payload)
}

# Send GET request with query parameters
response = requests.get(url, headers=headers, params=params, verify=True)

# Print response
print(response.status_code)
print(response.text)
		
# Base URL
$baseUrl = "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resourcegroup"

# Headers
$headers = @{
    "AUTHTOKEN" = "<<Authtoken-generated-from-PAM360>>"
    "Content-Type" = "application/x-www-form-urlencoded"
}

# Payload
$payload = @{
    operation = @{
        details = @{
            limit=3; startIndex=4; searchType="all"; searchValue="sample"; searchColumn="all";
        }
    }
}

# Convert payload to JSON
$jsonPayload = $payload | ConvertTo-Json -Compress -Depth 5

# Build URL correctly (IMPORTANT)
$url = $baseUrl + "?INPUT_DATA=" + [uri]::EscapeDataString($jsonPayload)


# Debug (optional but recommended)
Write-Output "Request URL:"
Write-Output $url

# Send GET request
$response = Invoke-WebRequest -Uri $url -Headers $headers -Method Get

# Print response
$response.Content

Sample Response

{
  "operation": {
    "result": {
      "message": "Resource group list fetched successfully",
      "status": "Success",
      "statusCode": 20000
    },
    "Details": [
      {
        "resourceGroupDescription": "Group of Windows resources",
        "accessType": "modify",
        "resourceGroupName": "a2",
        "isOwner": "false",
        "resourceGroupType": "dynamic",
        "resourceGroupId": "1201",
        "timeCreated": "2023-02-24 18:01:24.378",
        "subGroupOf": "1",
        "ownerId": "1"
      },
      {
        "resourceGroupDescription": "All the resources created by me",
        "accessType": "fullaccess",
        "resourceGroupName": "Default Group",
        "isOwner": "true",
        "resourceGroupType": "static",
        "resourceGroupId": "301",
        "timeCreated": "2023-02-14 14:55:22.998",
        "subGroupOf": "",
        "ownerId": "301"
      },
      {
        "resourceGroupDescription": "Group of Linux resources",
        "accessType": "fullaccess",
        "resourceGroupName": "st1",
        "isOwner": "false",
        "resourceGroupType": "static",
        "resourceGroupId": "1202",
        "timeCreated": "2023-02-24 18:02:10.251",
        "subGroupOf": "2",
        "ownerId": "1"
      },
      {
        "resourceGroupDescription": "Group of Windows Domain resources",
        "accessType": "fullaccess",
        "resourceGroupName": "static",
        "isOwner": "false",
        "resourceGroupType": "static",
        "resourceGroupId": "901",
        "timeCreated": "2023-02-24 16:08:26.262",
        "subGroupOf": "3",
        "ownerId": "1"
      }
    ],
    "name": "GET_RESOURCE_GROUPS",
    "totalRows": 4
  }
}



Top