Newer Version Available

This content describes an older version of this product. View Latest

postInsuranceCheckPlansEligibility(plansEligibilityInputParam, memberId)

Check the eligibility of a group census member for a given set of plans and create a new eligibility context.

API Version

65.0

Requires Chatter

No

Signature

public static ConnectApi.InsurancePlansEligibilityOutputRepresentation postInsuranceCheckPlansEligibility(ConnectApi.InsurancePlansEligibilityPostInputRepresentation plansEligibilityInputParam, String memberId)

Parameters

plansEligibilityInputParam
Type: ConnectApi.InsurancePlansEligibilityPostInputRepresentation
Input representation that contains the list of plans to check.
memberId
Type: String
ID of the group census member whose eligibility must be checked.

Example

1// Plans Eligibility (POST) via Connect API
2
3// 1) Build the input with plans
4ConnectApi.InsurancePlansEligibilityPostInputRepresentation input =
5    new ConnectApi.InsurancePlansEligibilityPostInputRepresentation();
6
7// Each plan requires a Contract Group Plan Id
8ConnectApi.InsuranceGroupPlanInputRepresentation plan1 =
9    new ConnectApi.InsuranceGroupPlanInputRepresentation();
10plan1.planId = '0rgSG0000000fXPYAY';
11
12// Optionally add coverages under the plan if applicable
13// plan1.coverages = new List<ConnectApi.InsuranceGroupPlanInputRepresentation>{ /* coverage items */ };
14
15// Provide one or more plans
16input.plans = new List<ConnectApi.InsuranceGroupPlanInputRepresentation>{ plan1 };
17
18// 2) Execute the POST with the Group Census Member Id
19String memberId = '0r6SG0000008n3CYAQ';
20
21try {
22    ConnectApi.InsurancePlansEligibilityOutputRepresentation result =
23        ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceCheckPlansEligibility(
24            input,
25            memberId
26        );
27
28    System.debug('Eligibility (POST) result: ' + JSON.serializePretty(result));
29} catch (Exception e) {
30    System.debug('Eligibility (POST) error: ' + e.getMessage());
31}