Fetch SSH Keys for a User

GET

This API retrieves all SSH keys associated with a specific user in PAM360. By providing the username and resource name, you can fetch the SSH keys assigned to that user.

Request URL

https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/api/pki/restapi/getSSHkeysforuser

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": {
			"userName": "administrator",
			"resourceName": "resource1"
		}
	}
}	

ParametersDescriptionValues

userName

Name of the user for whom the operation is performed.
Type : String
Mandatory : Yes

Default Value : N/A

resourceName

Name of the resource associated with the user.
Type : String
Mandatory : Yes

Default Value : N/A

Sample Request

cURLPythonPowerShell
curl -X GET https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/api/pki/restapi/getSSHkeysforuser -H "AUTHTOKEN: <<Authtoken-generated-from-PAM360>>" -H 'Content-Type: application/json' -G --data-urlencode INPUT_DATA={"operation":{"Details":{"userName":"administrator","resourceName":"resource1"}}}
import requests

url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/api/pki/restapi/getSSHkeysforuser"

params = {
	"INPUT_DATA": '{"operation":{"Details":{"userName":"administrator","resourceName":"resource1"}}}'
}

headers = {
	"AUTHTOKEN": "<<Authtoken-generated-from-PAM360>>"
}

response = requests.get(url, headers=headers, params=params, verify=True)

print("Response:", response.text)
$Url = "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/api/pki/restapi/getSSHkeysforuser"

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

$inputData = @{
	operation = @{
	Details = @{
	userName = "testuser"; resourceName = "resource1"
	}
	}
} | ConvertTo-Json -Compress

$params = @{ INPUT_DATA = $inputData }

$response = Invoke-WebRequest -Uri $Url -Headers $headers -Method GET -Body $params
$response.Content 

Sample Response

{
	"result": {
		"message": "SSH keys for user administrator of resource resource1 fetched successfully",
		"status": "Success"
	},
	"name": "GetSSHKeysForUser",
	"details": "ssh_test"
}



Top