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
Query Parameters
  • Attributes to be returned in the result. Policy ID is mandatory in attrbutes to return list. Comma-separated attributes are accepted.
  • 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".
  • 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 "::".
  • Returns the access policies which are related to the specified role. The role ID query parameter is valid when the "policyType" is "accessPolicy".
Back to Top

Response

Supported Media Types

200 Response

Successful
Headers
Body ()
Root Schema : BulkPolicyGetResponse
Type: object
Show Source
Nested Schema : policies
Type: array
Show Source
Nested Schema : Policy
Type: object
Show Source
Nested Schema : Owner
Type: object
Show Source
Nested Schema : rules
Type: array
Show Source
Nested Schema : LinkDataInstances
Type: object
Show Source
Nested Schema : PolicyRules
Type: object
Show Source

401 Response

Unauthorized

404 Response

Resource not found

500 Response

Internal Server Error

Default Response

Unexpected error
Back to Top

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."
            ]
        }
    ]
}
	
Back to Top