获取资源所属账户的密码
GET
此 API 用于获取 PAM360 中某个资源内特定账户的密码。响应结果将表明密码是否已成功获取。
请求 URL
https://<PAM360 服务器的主机名或 IP 地址>:<端口号>/restapi/json/v1/resources/<资源 ID>/accounts/<账户 ID>/password
| 参数 | 描述 | 值 |
|---|---|---|
RESOURCEID |
需要获取密码的资源的 ID。 |
默认值:不适用 |
ACCOUNTID |
需要获取密码的帐户的 ID。 |
默认值:不适用 |
标头参数
{
"AUTHTOKEN":"<<由PAM360生成的认证令牌>>",
"orgName" :"<<组织显示名称>>"
}
| 参数 | 描述 | 值 |
|---|---|---|
AUTHTOKEN |
用户用于授权 API 请求的身份验证令牌。 |
默认值:不适用 |
orgName |
PAM360 中可用的组织名称。 |
默认值: 用户所属的组织 。 |
查询参数
INPUT_DATA = {
"operation": {
"Details": {
"REASON":"需要密码登录 Windows Server",
"TICKETID":"7"
}
}
}
| 参数 | 描述 | 值 |
|---|---|---|
REASON |
访问或请求密码时提供的理由。 |
默认值:不适用 |
TICKETID |
与请求相关的票证 ID。 |
默认值:不适用 |
示例请求
cURL
Python
PowerShell
curl -G "https://<PAM360服务器的主机名或IP地址>:<端口>/restapi/json/v1/resources/603/accounts/603/password" -H "AUTHTOKEN:<<由PAM360生成的认证令牌>>" -H "Content-Type:application/x-www-form-urlencoded" --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"REASON\":\"需要密码登录 Windows 服务器\"}}}"
import requests url= "https://<PAM360服务器的主机名或IP地址>:<端口>/restapi/json/v1/resources/603/accounts/603/password" params = { "INPUT_DATA": """{ "operation": { "Details": { "REASON":"需要密码登录 Windows 服务器" } } }""" } headers = { "AUTHTOKEN":"<<由 PAM360 生成的认证令牌>>", "Content-Type": "application/x-www-form-urlencoded" } response = requests.get(url, headers=headers, params=params, verify=True) print(response.text)
$Url= "https://<PAM360服务器的主机名或IP地址>:<端口>/restapi/json/v1/resources/603/accounts/603/password" $Headers = @{ "AUTHTOKEN"="<<由PAM360生成的认证令牌>>" "Content-Type" = "application/x-www-form-urlencoded" } $Params = @{ "INPUT_DATA" = '{"operation":{"Details":{"REASON":"Need the password to Login Windows Server"}}}' } $response = Invoke-WebRequest -Uri $Url -Headers $Headers -Method Get -Body $Params -UseBasicParsing $response.Content
响应示例
{
"operation": {
"name":"GET PASSWORD",
"result": {
"status":"Success",
"message":"密码获取成功"
},
"Details": {
"PASSWORD":"by@1pBdasas"
}
}
}