Share an Account to a User
This API shares a specific account within a resource to a user in PAM360 by assigning the desired access type. The response confirms that the user has been granted the specified permission.
Request URL
https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources/<RESOURCEID>/accounts/<ACCOUNTID>/share
| Parameter | Description | Values |
|---|---|---|
RESOURCEID | The ID of the resource under which the account is present. | Default Value : N/A |
ACCOUNTID | The ID of the account that needs to be shared with the user. | 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. |
Body Parameters
INPUT_DATA = {
"operation": {
"Details": {
"ACCESSTYPE": "modify",
"USERID": "21"
}
}
}| Parameters | Description | Values |
|---|---|---|
ACCESSTYPE | The type of access to be granted or modified for the specified user. | Default Value : N/A |
USERID | The ID of the user for whom the access is being modified. | Default Value : N/A |
Sample Request
curl -X PUT "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/603/accounts/901/share" -H "AUTHTOKEN:<<Authtoken-generated-from-PAM360>>" -H "Content-Type: application/x-www-form-urlencoded" --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"ACCESSTYPE\":\"modify\",\"USERID\":\"21\"}}}"
import requests url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/603/accounts/901/share" headers = { "AUTHTOKEN": "<<Authtoken-generated-from-PAM360>>", "Content-Type": "application/x-www-form-urlencoded" } payload = { "INPUT_DATA": """{ "operation": { "Details": { "ACCESSTYPE": "modify", "USERID": "21" } } }""" } response = requests.put(url, headers=headers, data=payload, verify=True) print("Status Code:", response.status_code) print("Response:", response.text)
$Url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/603/accounts/901/share" $Headers = @{ "AUTHTOKEN" = "<<Authtoken-generated-from-PAM360>>" "Content-Type" = "application/x-www-form-urlencoded" } $Body = @{ "INPUT_DATA" = '{ "operation": { "Details": { "ACCESSTYPE": "modify", "USERID": "21" } } }' } $response = Invoke-RestMethod -Uri $Url -Method Put -Headers $Headers -Body $Body $response
Sample Response
{
"operation": {
"name": "SHARE ACCOUNT",
"result": {
"status": "Success",
"message": "View and Modify permission granted to user successfully."
}
}
}