Share an Account to a User

PUT

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

ParameterDescriptionValues

RESOURCEID

The ID of the resource under which the account is present.
Type : Integer
Mandatory : Yes

Default Value : N/A

ACCOUNTID

The ID of the account that needs to be shared with the user.
Type : Integer
Mandatory : Yes

Default Value : N/A

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.

Body Parameters

INPUT_DATA = {
		"operation": {
			"Details": {
			"ACCESSTYPE": "modify",
			"USERID": "21"
			}
		}
}

ParametersDescriptionValues

ACCESSTYPE

The type of access to be granted or modified for the specified user.
Type : String
Mandatory : Yes

Default Value : N/A
Allowed Values : view, modify, fullaccess, revoke

USERID

The ID of the user for whom the access is being modified.
Type : Integer
Mandatory : Yes

Default Value : N/A

Sample Request

cURLPythonPowerShell
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."
    }
  }
}



Top