Get list of segments for a specific policy by policy Id
get
/PASService/rest/services/v1/policies/{policyId}/segments
Gets a list of the latest 100 segments for 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 TopResponse
200 Response
This operation fetches list of segments for a specific policy by policy Id successfully.
Examples
This example describes how to get a list of the latest 100 segments for 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/B6780DC5-D0DE-431B-B049-82DBEE3C7D80/segments" Example Response Body
The following shows an example of the response body in JSON format:
{
"count": 3,
"offset": 0,
"limit": 100,
"segments": [
{
"links": [
{
"href": "http://server:port/PASService/rest/services/v1/policies/F8CC7B38-95F9-4240-A528-B890AF87188C/segments/D01AA0A5-D21E-44ED-8035-D3CBB276F883",
"rel": "self",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=Status&codeValue=24",
"rel": "codes/status",
"mediaType": "application/json",
"method": "GET"
}
],
"multiFields": {},
"effectiveDate": null,
"roles": [
{
"links": [
{
"href": "http://server:port/PASService/rest/services/v1/roles/0CA1DDA5-7683-42DA-837F-1EE0E45D05B4",
"rel": "self",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=PercentDollar&codeValue=C",
"rel": "codes/percentDollar",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=Role&codeValue=72",
"rel": "codes/role",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=State&codeValue=CA",
"rel": "codes/stateCode",
"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"
}
],
"fields": {},
"multiFields": {},
"roleAmount": 12.0,
"rolePercent": 100.0,
"stateCode": "CA",
"roleId": "0CA1DDA5-7683-42DA-837F-1EE0E45D05B4",
"clientId": "37D2EEE3-8624-48C6-981F-2B2891CDB852",
"externalclientId": "280D55E1-4BC6-4CA0-9AD2-BE6761DB55FC",
"companyId": "7560150B-BA78-45EF-8747-209DCB9BB94D",
"percentDollar": "C",
"policyId": "F8CC7B38-95F9-4240-A528-B890AF87188C",
"role": "72",
"segmentId": "D01AA0A5-D21E-44ED-8035-D3CBB276F883",
"status": "01"
}
],
"segmentId": "D01AA0A5-D21E-44ED-8035-D3CBB276F883",
"parentSegmentId": null,
"policyId": "F8CC7B38-95F9-4240-A528-B890AF87188C",
"segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
"status": "24",
"planSegmentNameId": null,
"segmentName": {
"multiFields": null,
"segmentName": "Base Coverage",
"activeFromDate": null,
"activeToDate": null,
"planSegmentName": null,
"segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
"planId": "C5EE0DA4-3003-42C1-9468-D91DA546B79F",
"productId": null,
"type": "04",
"status": "01"
},
"SegmentAmount": {
"value": 51000.0,
"currency": "USD"
}
},
{
"links": [
{
"href": "http://server:port/PASService/rest/services/v1/policies/F8CC7B38-95F9-4240-A528-B890AF87188C/segments/D7DA7975-A0F0-45F8-B332-884069AA745F",
"rel": "self",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=Status&codeValue=24",
"rel": "codes/status",
"mediaType": "application/json",
"method": "GET"
}
],
"multiFields": {},
"effectiveDate": null,
"roles": [],
"segmentId": "D7DA7975-A0F0-45F8-B332-884069AA745F",
"parentSegmentId": null,
"policyId": "F8CC7B38-95F9-4240-A528-B890AF87188C",
"segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
"status": "24",
"planSegmentNameId": null,
"segmentName": {
"multiFields": null,
"segmentName": "Base Coverage",
"activeFromDate": null,
"activeToDate": null,
"planSegmentName": null,
"segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
"planId": "C5EE0DA4-3003-42C1-9468-D91DA546B79F",
"productId": null,
"type": "04",
"status": "01"
},
"SegmentAmount": {
"value": 51000.0,
"currency": "USD"
}
},
{
"links": [
{
"href": "http://server:port/PASService/rest/services/v1/policies/F8CC7B38-95F9-4240-A528-B890AF87188C/segments/71A92161-CC46-44F6-85E1-6FACDFE7961D",
"rel": "self",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=Status&codeValue=24",
"rel": "codes/status",
"mediaType": "application/json",
"method": "GET"
}
],
"multiFields": {},
"effectiveDate": null,
"roles": [
{
"links": [
{
"href": "http://server:port/PASService/rest/services/v1/roles/B8D6328F-07CD-4A94-BB4C-F82DC04A3420",
"rel": "self",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=PercentDollar&codeValue=C",
"rel": "codes/percentDollar",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=Role&codeValue=72",
"rel": "codes/role",
"mediaType": "application/json",
"method": "GET"
},
{
"href": "http://server:port/PASService/rest/services/v1/codes?codeName=State&codeValue=CA",
"rel": "codes/stateCode",
"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"
}
],
"fields": {},
"multiFields": {},
"roleAmount": 12.0,
"rolePercent": 100.0,
"stateCode": "CA",
"roleId": "B8D6328F-07CD-4A94-BB4C-F82DC04A3420",
"clientId": "37D2EEE3-8624-48C6-981F-2B2891CDB852",
"externalclientId": "4B29A809-18AD-4D2F-9B0F-821049FCFF63",
"companyId": "2A93476C-E995-4001-870E-287EE8475921",
"percentDollar": "C",
"policyId": "F8CC7B38-95F9-4240-A528-B890AF87188C",
"role": "72",
"segmentId": "71A92161-CC46-44F6-85E1-6FACDFE7961D",
"status": "01"
}
],
"segmentId": "71A92161-CC46-44F6-85E1-6FACDFE7961D",
"parentSegmentId": null,
"policyId": "F8CC7B38-95F9-4240-A528-B890AF87188C",
"segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
"status": "24",
"planSegmentNameId": null,
"segmentName": {
"multiFields": null,
"segmentName": "Base Coverage",
"activeFromDate": null,
"activeToDate": null,
"planSegmentName": null,
"segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
"planId": "C5EE0DA4-3003-42C1-9468-D91DA546B79F",
"productId": null,
"type": "04",
"status": "01"
},
"SegmentAmount": {
"value": 51000.0,
"currency": "USD"
}
}
]
}