Fetch Resources Owned and Shared to a User
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>>"
}| Parameter | Description | Values |
|---|---|---|
AUTHTOKEN | Authentication token of the user to authorize the API request. | Default Value : N/A |
orgName | Organization name available in PAM360. | 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"
}
}
}| Parameters | Description | Values |
|---|---|---|
VIEWTYPE | Specifies the category of passwords to be retrieved. | Default Value : ALLMYPASSWORD |
STARTINDEX | Indicates the starting point or index of the result set. | Default Value : 0 |
LIMIT | Specifies the maximum number of records to be fetched. | Default Value : All resources will be fetched. |
SEARCHTYPE | Defines whether the search should be performed on resources or accounts. | Default Value : N/A |
SEARCHVALUE | The keyword used for the search. | Default Value : N/A |
SEARCHCOLUMN | Specifies the columns where the search should be applied. | Default Value : N/A |
Sample Request
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
}
}