Fetch the Resource ID and Account ID
GET
This API retrieves the resource ID and the account ID in PAM360. By providing the resource name and account name, you can obtain the unique IDs associated with both the resource and its account.
Request URL
https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources/getResourceIdAccountId? RESOURCENAME=<RESOURCENAME>&ACCOUNTNAME=<ACCOUNTNAME>
| Parameter | Description | Values |
|---|---|---|
RESOURCENAME | The name of the resource for which the ID needs to be fetched. | Default Value : N/A |
ACCOUNTNAME | The name of the account for which the ID needs to be fetched. | Default Value : N/A |
Header Parameters
{
"AUTHTOKEN" : "<<Authtoken-generated-from-PAM360>>",
"orgName" : "<<org display name>>"
}| Parameter | Description | Values |
|---|---|---|
AUTHTOKEN | Authentication token for 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. |
Sample Request
cURLPythonPowerShell
curl -X GET "https://<Host-Name-or-IP-address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/getResourceIdAccountId?RESOURCENAME=Windows%20Server&ACCOUNTNAME=Administrator" -H "AUTHTOKEN: <<Authtoken-generated-from-PAM360>>"
import requests # URL url = "https://<Host-Name-or-IP-address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/getResourceIdAccountId" params = { "RESOURCENAME": "Windows Server", "ACCOUNTNAME": "Administrator" } # Headers headers = { "AUTHTOKEN": "<<Authtoken-generated-from-PAM360>>" } # Send GET request response = requests.get(url, headers=headers, params=params, verify=True) # Print only the API response body print(response.text)
# URL $url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/getResourceIdAccountId?RESOURCENAME=Windows%20Server&ACCOUNTNAME=Administrator" # Headers $headers = @{ "AUTHTOKEN" = "<<Authtoken-generated-from-PAM360>>" } # Send GET request $response = Invoke-WebRequest -Uri $url -Method Get -Headers $headers # Print only the API response body $response.Content
Sample Response
{
"operation": {
"result": {
"message": "Resource ID and account ID fetched successfully for the given resource name and account name.",
"status": "Success"
},
"Details": {
"ACCOUNTID": "603",
"RESOURCEID": "603"
},
"name": "GET_RESOURCEACCOUNTID"
}
}