Update Policy Based on Policy ID
put
/iam/governance/selfservice/api/v1/policies/{policyid}
Updates the policy with the attributes passed in the payload. In scenarios where the "action" query parameter is used to validate the policy the response will capture the "errorMessage" when the validation fails. The validation is supported for password and username policy types.
Request
Supported Media Types
- application/json
Path Parameters
-
policyid(required): string
Policy ID of the policy to be updated.
Query Parameters
-
action: string
Action against policy ID. Current release supports "validate" action. for example /policies/{policyid}?action=validate. The query parameter is supported for password and username policies only. When the URI is invoked with action query the contents in the payload will be used to check the validation. For example in case of password policy the request payload should have the password which is to be validated. All the other attributes even if specified will be ignored. None of the attributes mentioned in the request payload will be updated with query parameter "action".
-
policyType(required): string
Policy type of the policy ID which is being returned. If the policy ID does not match to the Policy Type then no updates will be performed.
Attributes of the policy to be updated.
Response
Supported Media Types
- application/json
200 Response
Successful
Headers
-
ResponseTime: string
Captures the time in milliseconds taken for processing the request.
401 Response
Unauthorized
404 Response
Requested entity not found
500 Response
Internal Server Error
Default Response
Unexpected error
Examples
This example demonstrates the ability to check that the password meets policies. The information shown here is against a pseudo system and serves as a prototype.
cURL Example
curl -H "Content-Type: application/json" -H "X-Requested-By: <anyvalue>" -X PUT -u username:password -d @put.json https://pseudo.com/iam/governance/selfservice/api/v1/policies/1? policyType=passwordPolicy&action=validate
Example of PUT Request Body
The following example shows the contents of the request body in JSON format.
{
"requestId": "1001",
"attributes" : [
{
"name" : "password",
"value" : "PASSWORD"
}
]
}
Example of PUT Response Body
The following example shows the contents of the response body in JSON format.
{
"links": [
{
"rel": "self",
"href": "http://pseudo.com:PORT/iam/governance/selfservice/api/v1/policies/1?
policyType=passwordPolicy"
}
],
"requestId": "1001",
"status": "Valid Password"
}