Previous Next JavaScript must be enabled to correctly display this content

## Get list of roles for a specific policy by policy Id

get

/PASService/rest/services/v1/policies/{policyId}/roles

Gets a list of roles associated to a policy based on the specified policy Id.

### Request

Path Parameters

- policyId(required): string(guid)
  Policy Id

Query Parameters

- expand: string
  When this parameter is provided, the specified children are included in the resource payload (instead of just a link). The value of this query parameter is "all" or "the name of the child resource". More than one child can be specified using comma as a separator. Example:?expand=Employees,Localizations. Nested children can also be provided following the format "Child.NestedChild" (Example: ?expand=Employees.Managers). If a nested child is provided (Example: Employees.Managers), the missing children will be processed implicitly. For example, "?expand=Employees.Managers" is the same as "?expand=Employees,Employees.Managers" (which will expand Employees and Managers). More than one child can be specified using comma as a separator. For example: "?expand=Employees,Localizations". Nested children can also be provided following the format: "Child.NestedChild" For example:"?expand=Employees.Managers" If a nested child is provided (Example:Employees.Managers), the missing children will be processed implicitly i.e.,"?expand=Employees.Managers" is the same as "?expand=Employees,Employees.Managers", which will expand both Employees and Managers.
- limit: integer(int32)
  This parameter restricts the number of resources returned inside the resource collection. If the limit exceeds the resource count then the framework will only return the available resources.
- offset: integer(int32)
  Used to define the starting position of the resource collection. If offset exceeds the resource count then no resources are returned. Default value is 0.
- q: string
  This query parameter defines the where clause. The resource collection will be queried using the provided expressions. The value of this query parameter is one or more expressions. Example: ?q=Deptno>=10 and <= 30;loc!="NY.

There's no request body for this operation.

Back to Top

### Response

#### 200 Response

This operation fetches list of of roles for a specific policy by policy Id successfully.
Back to Top

### Examples

This example describes how to get a list of roles associated to a policy based on the specified policy Id.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl \
        -X GET \
        -H "Content-Type: application/json" \
        -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
        -L "http://server:port/PASService/rest/services/v1/policies/22E39E64-7876-4A61-B5FE-9E45A291C54D/roles"

Example Response Body

The following shows an example of the response body in JSON format:

    {
        "count": 2,
        "offset": 0,
        "limit": 100,
        "roles": [
            {
                "links": [
                    {
                        "href": "http://server:port/PASService/rest/services/v1/policies/08739DA7-D305-450F-975A-44B269B159CD/roles/FCDE474F-B328-47C0-AC40-2888A0A6E0BF",
                        "rel": "self",
                        "mediaType": "application/json",
                        "method": "GET"
                    },
                    {
                        "href": "http://server:port/PASService/rest/services/v1/codes?codeName=Role&codeValue=11",
                        "rel": "codes/role",
                        "mediaType": "application/json",
                        "method": "GET"
                    },
                    {
                        "href": "http://server:port/PASService/rest/services/v1/codes?codeName=RoleStatus&codeValue=01",
                        "rel": "codes/status",
                        "mediaType": "application/json",
                        "method": "GET"
                    }
                ],
                "multiFields": {},
                "roleAmount": null,
                "rolePercent": null,
                "stateCode": null,
                "roleId": "FCDE474F-B328-47C0-AC40-2888A0A6E0BF",
                "clientId": "23D8108C-A278-4A8C-89FC-C64EB37EF1A1",
                "externalclientId": null,
                "companyId": null,
                "percentDollar": null,
                "policyId": "08739DA7-D305-450F-975A-44B269B159CD",
                "role": "11",
                "segmentId": null,
                "status": "01"
            },
            {
                "links": [
                    {
                        "href": "http://server:port/PASService/rest/services/v1/policies/08739DA7-D305-450F-975A-44B269B159CD/roles/825AA2DD-B353-4E3B-881C-528D53F6F61B",
                        "rel": "self",
                        "mediaType": "application/json",
                        "method": "GET"
                    },
                    {
                        "href": "http://server:port/PASService/rest/services/v1/codes?codeName=Role&codeValue=37",
                        "rel": "codes/role",
                        "mediaType": "application/json",
                        "method": "GET"
                    },
                    {
                        "href": "http://server:port/PASService/rest/services/v1/codes?codeName=RoleStatus&codeValue=01",
                        "rel": "codes/status",
                        "mediaType": "application/json",
                        "method": "GET"
                    }
                ],
                "multiFields": {
                    "MultiFieldRoleScreen": [
                        {
                            "index": 0,
                            "RoleMultiField": null
                        }
                    ]
                },
                "roleAmount": null,
                "rolePercent": 100.0,
                "stateCode": null,
                "roleId": "825AA2DD-B353-4E3B-881C-528D53F6F61B",
                "clientId": "7A51150D-EA45-4271-B64D-8ADC849F5751",
                "externalclientId": null,
                "companyId": null,
                "percentDollar": null,
                "policyId": "08739DA7-D305-450F-975A-44B269B159CD",
                "role": "37",
                "segmentId": null,
                "status": "01",
                "BillingSelectAddress": {
                    "textValue": "01",
                    "optionText": "Electronic Funds Transfer"
                },
                "DeliveryAgent": null,
                "Billing": {
                    "textValue": "01",
                    "optionText": "Yes"
                },
                "DepartmentName": null,
                "TransactionField": null,
                "TestCollection": null,
                "TestField": null,
                "DeliveryType": null,
                "GraceLapseNotices": {
                    "textValue": "01",
                    "optionText": "Yes"
                }
            }
        ]
    }

Back to Top