U bent hier:
InsCensusService:updateMembersWithPlans
Gebruik deze service om een telling in te vullen met primaire leden, hun gezinsleden en hun vooraf ingeschreven plan.
Methode: updateMembersWithPlans
De manier waarop het werkt...
-
De service roept
updateMembersaan om gegevens over de leden op te slaan, de leden te parseren in het JSON-object en voor elk ervan een ID enisNewMembertoe te voegen. -
De service roept vervolgens
addPlanSelectionsaan om de vooraf ingeschreven plannen van leden op te slaan. -
Als
isNewMemberis ingesteld op true (waar), verwijdertaddPlanSelectionsalle nieuw gemaakte leden die geen items inGroupCensusMemberPlan__chebben en als de parameteronlySaveMembersWithValidProductsis ingesteld op true (waar).
Externe opties
Optie |
Beschrijving |
|---|---|
|
Verplicht ID van de telling waar leden die moeten worden geüpload, toe behoren of zullen behoren. Gebruikt om te valideren dat de contractId bij de account/telling hoort. |
|
Verplicht ID van het huidige contract van Account. Wordt gebruikt om te valideren dat de plannen van elk lid deel uitmaken van het contract. |
|
Booleaans indien true (waar), worden nieuwe leden zonder |
|
Getekende lijst Lijst van veldAPI-namen van Gebruikt om te bepalen welke leden al voorkomen in de tabel, in welk geval een update wordt uitgevoerd in plaats van een invoeging. |
Invoer-JSON
Zo ziet de indeling eruit voor de invoer-JSON:
{
"censusId":"a4D4P000000hbjSUAQ",
"contractId":"a4D4P000000yujQER",
"onlySaveMembersWithValidProducts":true,
"census":{
"headers":[
{
"name":"vlocity_ins__FirstName__c"
},
{
"name":"vlocity_ins__LastName__c"
},
{
"name":"vlocity_ins__IsPrimaryMember__c"
},
{
"name":"vlocity_ins__IsSpouse__c"
},
{
"name":"vlocity_ins__MemberIdentifier__c"
},
{
"name":"vlocity_ins__PrimaryMemberIdentifier__c"
},
{
"name":"Id"
},
{
"name":"vlocity_ins__ContractLineId__c"
},
{
"name":"vlocity_ins__IsOptOut__c"
},
{
"name":"vlocity_ins__OptOutTypes__c"
}
],
"members":[
{
"vlocity_ins__FirstName__c":"Maurice",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":true,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Maurice",
"vlocity_ins__PrimaryMemberIdentifier__c":null,
"vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ;a4D4P000000hbjSUAQ",
"vlocity_ins__IsOptOut__c" : false,
"vlocity_ins__OptOutTypes__c" :null
},
{
"vlocity_ins__FirstName__c":"Lizzy",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":false,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Lizzy",
"vlocity_ins__PrimaryMemberIdentifier__c":"Maurice",
"vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ",
"vlocity_ins__IsOptOut__c" :true,
"vlocity_ins__OptOutTypes__c" :null
},
{
"vlocity_ins__FirstName__c":"Jamie",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":false,
"vlocity_ins__IsSpouse__c":true,
"vlocity_ins__MemberIdentifier__c":"Jamie",
"vlocity_ins__PrimaryMemberIdentifier__c":"Maurice",
"vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ",
"vlocity_ins__IsOptOut__c" : false,
"vlocity_ins__OptOutTypes__c" :"Medical"
},
{
"vlocity_ins__FirstName__c":"Bella",
"vlocity_ins__LastName__c":"James",
"vlocity_ins__IsPrimaryMember__c":true,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Bella",
"vlocity_ins__PrimaryMemberIdentifier__c":null,
"vlocity_ins__ContractLineId__c":null,
"vlocity_ins__IsOptOut__c" :true,
"vlocity_ins__OptOutTypes__c" :null
}
]
},
"duplicateKeys" : [
"vlocity_ins__FirstName__c",
"vlocity_ins__LastName__c"
]
}Uitvoer-JSON
Hier is een voorbeeld van uitvoer-JSON:
{
"errors":[
{
"error":"ContractLineItem__c value is not valid:8004P000000zJKjQAM; Medical",
"vlocity_ins__FirstName__c":"Maurice",
"vlocity_ins__LastName__c":"Johnson",
"vlocity_ins__IsPrimaryMember__c":true,
"vlocity_ins__IsSpouse__c":false,
"vlocity_ins__MemberIdentifier__c":"Maurice",
"vlocity_ins__PrimaryMemberIdentifier__c":null
}
],
"censusMemberIds":[
"a4C4P000000ed6dUAA",
"a4C4P000000ed6eUAA",
"a4C4P000000ed6fUAA"
],
"memberPlanIds":[
"a4B4P000006jKsMUAU",
"a4B4P000006jKsNUAU",
"a4B4P000006jKsOUAU",
"a4B4P000006jKsPUAU"
]
}