要详细了解对象关系以及如何在 API 中使用对象关系,请转至 对象关系 部分。
如需详细了解凭证,请访问 凭证 帮助页面。
要检索所有可访问的凭证记录,请使用
GET {baseURL}/v3/credentials
端点。
注意
如果您不是管理员,则结果仅限于您可以访问和查看的凭证,userId 和 userGroupId 参数将被忽略。
view (string):可选。可以保留此参数但不为其提供值。您可以从以下值中选择:“默认值”和“全部”。如果此参数设置为“Default”,则将返回一个减小的视图对象。未指定时,将使用“默认值(Default)”。
userId (string):可选。要按 userId 筛选结果,请输入用户的 ID。
userGroupId (string):可选。要按 userGroupId 筛选结果,请输入用户组的 ID。
要检索有关现有凭证的详细信息,请使用
GET {baseURL}/v3/credentials/{credentialId}
端点。
credentialId (string):必填。输入集合 ID 以获取有关特定凭证的信息。
To create a credential record, use the POST {baseURL}/v3/credentials
endpoint.
注意
Only Curators can use this API endpoint.
This API endpoint is disabled if TLS is not enabled.
The API validates the username and password and only creates credentials for existing Windows logins with valid passwords.
addContract (body): Required. Specify the following to create a new credential:
password (string) Required. Specify the password for the username of the new credential to be added.
username (string) Required. Specify the username of the new credential to be added.
To update a credential record, use the PUT {baseURL}/v3/credentials/{credentialId}
endpoint.
注意
Only Curators can use this API endpoint.
This API endpoint is disabled if TLS is not enabled.
This API endpoint validates the username and password and only updates credentials for existing Windows logins with valid passwords.
updateContract (body): Required. Specify the following to update a credential with a new password:
NewPassword (string): Required. Specify the new password for the credential ID.
credentialId (string) Required. Enter the ID of the credential to update.
要与现有用户共享现有凭证,请使用
POST {baseURL}
/v3/credentials/{credentialId}/users
端点。
注意
只有管理员可以使用此 API 端点。
credentialId (string):必填。输入要共享的集合 ID。
contract (body):必填。指定以下参数以与用户共享凭证:
userId (string):必填。指定要与其共享凭证的用户的 ID。
要与现有用户组共享现有凭证,请使用
POST {baseURL}
/v3/credentials/{credentialId}/userGroups
端点。
注意
只有管理员可以使用此 API 端点。
credentialId (string):必填。输入要共享的凭证 ID。
contract (body):必填。指定以下参数以与用户组共享凭证:
userGroupId (string):必填。指定要与其共享凭证的用户组的 ID。
要移除用户使用现有凭证的权限,请使用
DELETE {baseURL}/v3/credentials/{credentialId}/users/{userId}
端点。
注意
只有管理员可以使用此 API 端点。
credentialId (string):必填。输入要从中移除用户的凭证 ID。
userId (string):必填。输入要从凭证中移除的用户 ID。
要移除用户组使用现有凭证的权限,请使用
DELETE {baseURL}/v3/credentials/{credentialId}/userGroups/{userGroupId}
端点。
注意
只有管理员可以使用此 API 端点。
credentialId (string):必填。输入要从中移除用户组的凭证 ID。
userGroupId (string):必填。输入要从凭证中移除的用户组 ID。
要删除现有凭证,请使用
DELETE {baseURL}/v3/credentials/{credentialId}
端点。
注意
只有管理员可以使用此 API 端点。
credentialId (string):必填。输入要删除的凭证 ID。
force (boolean):可选。选择是否要在存在任何共享的情况下强制删除凭证。如果您想要删除凭证并清除所有共享,请将 force 参数设置为 true。如果未选择,则默认值为 false。这是为了防范错误调用。
要获取有关现有凭证 ID 的信息,请使用 GET /v3/credentials 端点。您获得的 credentialId 可以在以下情况下使用:
您想要 获取有关特定凭证的信息 。
您想要 与用户共享凭证 。
您想要 与用户组共享凭证 。
您想要 从凭证中移除用户 。
您想要 从凭证中移除用户组 。
您想要 删除特定凭证 。
You want to update a specific credential.