Get Policy
get
/iam/governance/selfservice/api/v1/policies
Returns all the access,username and approval policies of the specified type. Additional filters can be added to get more specifics. For example, to get all the access policies that have the name starting with "A" and a role Employee (with roleID=1234)in it the URI will be /policies?policyType=accessPolicy&roleid=1234&q=name sw "A"
Request
Supported Media Types
- application/json
Query Parameters
-
fields: string
Attributes to be returned in the result. Policy ID is mandatory in attrbutes to return list. Comma-separated attributes are accepted.
-
policyType(required): string
Enables to get the policies which are of the type specified in the policyType query parameter. The supported values are "usernamePolicy, passwordPolicy, accessPolicy and approvalPolicy".
-
q(required): string
The filter enables to get a subset of the policies of the type specified in the "policyType" query parameter. SCIM filter is accepted. There should not be any spaces for attribute value. If you want to pass space in between attribute values then replace it with "::".
-
roleid: string
Returns the access policies which are related to the specified role. The role ID query parameter is valid when the "policyType" is "accessPolicy".
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
Resource not found
500 Response
Internal Server Error
Default Response
Unexpected error
Examples
This example retrieves all the policies of type passwordPolicy. The information shown here is against a pseudo system and serves as a prototype.
cURL Example
curl -H "Content-Type: application/json" -X GET -u username:password https://pseudo.com/iam/governance/selfservice/api/v1/policies?policyType=passwordpolicy
Example of GET 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? policyType=passwordpolicy&offset=1&limit=10" }, { "rel": "first", "href": "http://pseudo.com:PORT/iam/governance/selfservice/api/v1/policies? policyType=passwordpolicy&offset=1&limit=10" } ], "count": 1, "hasMore": false, "totalResult": -1, "policies": [ { "links": [ { "rel": "self", "href": "http://pseudo.com:PORT/iam/governance/selfservice/api/v1/policies/1? policyType=passwordPolicy" } ], "id": "1", "pwr_name": "Default Policy", "pwr_desc": "This is the Default OIM Password Policy", "rules": [ "Password must not match or contain first name.", "Password must not match or contain last name.", "Password must contain at least 2 alphabetic character(s).", "Password must be at least 8 character(s) long.", "Password must contain at least 1 lowercase letter(s).", "Password must contain at least 1 numeric character(s).", "Password must contain at least 1 uppercase letter(s).", "Password must start with an alphabetic character.", "Password must not match or contain user ID." ] } ] }