Fetch Resources Owned and Shared to a User

GET

This API retrieves the complete list of resources associated with the user. The response includes both resources that the user directly owns and those that have been shared with the user by other owners.

Request URL

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

Header Parameters

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

ParameterDescriptionValues

AUTHTOKEN

Authentication token of 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" : {
	"VIEWTYPE"    : "ALLMYPASSWORD",
	"STARTINDEX"  : 0,
	"LIMIT"       : 10,
	"SEARCHTYPE"  : "RESOURCE",
	"SEARCHVALUE" : "CNS-E01",
	"SEARCHCOLUMN": "RESOURCENAME"
	}
}
}

ParametersDescriptionValues

VIEWTYPE

Specifies the category of passwords to be retrieved.
Type : String
Mandatory : No

Default Value : ALLMYPASSWORD
Allowed Values : ALLMYPASSWORD, FAVOURITEPASSWORD, RECENTLYACCESSEDPASSWORD, LINUXSSHPASSWORD, WINDOWSRDPPASSWORD

STARTINDEX

Indicates the starting point or index of the result set.
Type : Integer
Mandatory : No

Default Value : 0

LIMIT

Specifies the maximum number of records to be fetched.
Type : Integer
Mandatory : No

Default Value : All resources will be fetched.

SEARCHTYPE

Defines whether the search should be performed on resources or accounts.
Type : String
Mandatory : No

Default Value : N/A
Allowed Values : RESOURCE, ACCOUNT

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 : ALL, RESOURCE_TYPE, RESOURCENAME, RESOURCEDESC, IPADDRESS, LOGINNAME, OPERATINGSYSTEM, DEPARTMENT, LOCATION, DOMAINNAME, RESOURCEURL, COLUMN_CHAR[0-9]*, COLUMN_LONG[0-9]*, COLUMN_SCHAR[0-9]*, COLUMN_DATE[0-9]*, COLUMN_FILE[0-9]*

Sample Request

cURLPythonPowerShell
curl GET -G -H "Content-Type: application/x-www-form-urlencoded" -H "AUTHTOKEN: <Authtoken-generated-from-PAM360>" https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"VIEWTYPE\":\"ALLMYPASSWORD\",\"STARTINDEX\":\"1\",\"LIMIT\":\"10\",\"SEARCHTYPE\":\"RESOURCE\",\"SEARCHVALUE\":\"CNS-E01\",\"SEARCHCOLUMN\":\"ALL\"}}}"
#!/usr/bin/env python3
 
import requests
import urllib3
import json
 
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
 
def main():
    config = {
        "auth_token": "<<Authtoken-generated-from-PAM360>>",
        "host_name": "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>"
    }
 
    session = requests.Session()
    session.verify = True   # set False only if self-signed cert
 
    try:
        url = f"{config['host_name']}/restapi/json/v1/resources"
 
        headers = {
            "AUTHTOKEN": config["auth_token"]
        }
 
        input_data = {
            "operation": {
                "Details": {
                    "VIEWTYPE": "ALLMYPASSWORD",
                    "STARTINDEX": "1",
                    "LIMIT": "10",
                    "SEARCHTYPE": "RESOURCE",
                    "SEARCHVALUE": "CNS-E01",
                    "SEARCHCOLUMN": "ALL"
                }
            }
        }
 
        # INPUT_DATA must be a JSON STRING
        params = {
            "INPUT_DATA": json.dumps(input_data)
        }
 
        response = session.get(
            url,
            headers=headers,
            params=params,
            timeout=10
        )
 
        print("Status Code:", response.status_code)
        print("Response:")
        print(response.text)
 
    except Exception as e:
        print("Error:", e)
 
    finally:
        session.close()


if __name__ == "__main__":
    main()
$Url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources"

$Body = @{
	"INPUT_DATA" = '{ "operation": { "Details": {
		"VIEWTYPE": "ALLMYPASSWORD",
		"STARTINDEX": 1,
		"LIMIT": 10,
		"SEARCHTYPE": "RESOURCE",
		"SEARCHVALUE": "CNS-E01",
		"SEARCHCOLUMN": "RESOURCENAME"
	} } }'
}

$Header = @{
	"AUTHTOKEN" = "<Authtoken-generated-from-PAM360>"
}

$response = Invoke-WebRequest -Method Get -Headers $Header -Uri $Url -Body $Body
$response.Content

Sample Response

{
  "operation": {
    "result": {
      "message": "Resources fetched successfully",
      "status": "Success"
    },
    "Details": [
      {
        "RESOURCE DESCRIPTION": "",
        "RESOURCE TYPE": "Windows",
        "RESOURCE ID": "1",
        "RESOURCE NAME": "CNS-E01",
        "NOOFACCOUNTS": "2",
        "DNS NAME": ""
      }
    ],
    "name": "GET RESOURCES",
    "totalRows": 1
  }
}



Top