All Classes Pages
EditGroupCustomerExamples Class Reference

More...

Detailed Description

Examples for Edit Group Customer

Example 1 - Edit customer attributes of a group customer

This example demonstrates the following:

  • Editing all the allowed customer attributes of a group customer.

XML

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Content-Type application/xml
Accept-Language en-US

Request body

<customer
    xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer"
    xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/platform"
    xmlns:ns3="http://bindings.egain.com/ws/model/v12/gen/common"
    xmlns:ns4="http://bindings.egain.com/ws/model/v12/gen/interaction/contactperson"
    xmlns:ns5="http://bindings.egain.com/ws/model/v12/gen/interaction/contactpoint" id='1003'>
    <type>
        <group>
            <type>
                <ns3:value>Association</ns3:value>
            </type>
            <region>Europe</region>
            <numberOfMembers>30000</numberOfMembers>
            <income>12000000</income>
            <currency>Dollar</currency>
            <registrationNumber>EK123/234</registrationNumber>
            <affiliation></affiliation>
        </group>
    </type>
    <customerName>Finance Investor </customerName>
    <level>
        <ns3:value></ns3:value>
    </level>
    <role>
        <ns3:value>Partner</ns3:value>
    </role>
    <pin>123098</pin>
    <howReferred>
        <ns3:value>Customer</ns3:value>
    </howReferred>
    <industry>
        <ns3:value>Telecom</ns3:value>
    </industry>
    <marketSegment>Medical Products</marketSegment>
    <entitlements>Free service</entitlements>
    <customAttributes>
        <ns3:customAttribute>
            <ns3:attribName>preferredlang</ns3:attribName>
            <ns3:attribValues>
                <ns3:attribValue>
                    <ns3:value>English</ns3:value>
                </ns3:attribValue>
            </ns3:attribValues>
        </ns3:customAttribute>
    </customAttributes>
</customer>

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

     


JSON

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Content-Type application/json
Accept-Language en-US

Request body

{
		"id": "1003",
        "type": {
            "group": {
                "type": {
                    "value": "Association"
                },
                "region": "Europe",
                "numberOfMembers": "30000",
                "income": "12000000",
                "currency": "Dollar",
                "registrationNumber": "EK123/234",
                "affiliation": ""
            }
        },
        "customerName": "Finance Investor ",
        "level": {
            "value": ""
        },
        "role": {
            "value": "Partner"
        },
        "pin": "123098",
        "howReferred": {
            "value": "Customer"
        },
        "industry": {
            "value": "Telecom"
        },
        "marketSegment": "Medical Products",
        "entitlements": "Free service",
        "customAttributes": {
            "customAttribute": [{
                "attribName": "preferredlang",
                "attribValues": {
                    "attribValue": [{
                        "value": "English"
                    }]
                }
            }]
        }
}

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json

     



Example 2 - Edit existing contact person for the customer

This example demonstrates the following:

  • Editing all attributes of an existing contact person of a group customer.

XML

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Content-Type application/xml
Accept-Language en-US

Request body

<customer xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer"
xmlns:ns1="http://bindings.egain.com/ws/model/v12/gen/interaction/contactperson"
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/platform"
xmlns:ns3="http://bindings.egain.com/ws/model/v12/gen/common"
xmlns:ns4="http://bindings.egain.com/ws/model/v12/gen/interaction/contactpoint" id='1000'>
   <contactPersons>
      <ns1:contactPerson id='1000'>
         <ns1:salutation>Mr.</ns1:salutation>
         <ns1:firstName>John</ns1:firstName>
         <ns1:middleName>Russel</ns1:middleName>
         <ns1:lastName>Tierney</ns1:lastName>
         <ns1:gender>
            <ns3:value>male</ns3:value>
         </ns1:gender>
         <ns1:identification>
            <ns1:type>Passport</ns1:type>
            <ns1:value>AE0000005</ns1:value>
         </ns1:identification>
         <ns1:suffix>
            <ns3:value>jr.</ns3:value>
         </ns1:suffix>
         <ns1:initials>A.</ns1:initials>
         <ns1:secretQuestion>Place of Birth</ns1:secretQuestion>
         <ns1:secretAnswer>Texas</ns1:secretAnswer>
         <ns1:hasDirectMailingConsent>true</ns1:hasDirectMailingConsent>
         <ns1:hasDirectCallingConsent>true</ns1:hasDirectCallingConsent>
         <ns1:hasHoldingDataConsent>true</ns1:hasHoldingDataConsent>
         <ns1:jobTitle>Manager</ns1:jobTitle>
         <ns1:employmentStatus>
            <ns3:value>intern</ns3:value>
         </ns1:employmentStatus>
         <ns1:priority>High</ns1:priority>
         <ns1:dateOfBirth>1965-12-09T00:00:00.000Z</ns1:dateOfBirth>
         <ns1:maritalStatus>
            <ns3:value>married</ns3:value>
         </ns1:maritalStatus>
         <ns1:type>
            <ns3:value>Billing</ns3:value>
         </ns1:type>
         <ns1:firstNameFurigana>John</ns1:firstNameFurigana>
         <ns1:middleNameFurigana>Russel</ns1:middleNameFurigana>
         <ns1:lastNameFurigana>Tierney</ns1:lastNameFurigana>
         <ns1:startGreeting>Welcome</ns1:startGreeting>
         <ns1:endGreeting>Thanks, Byee</ns1:endGreeting>
         <ns1:spouseName>Jenifer</ns1:spouseName>
         <ns1:emergencyContact>0987654321</ns1:emergencyContact>
         <ns1:occupation>Branch Manager</ns1:occupation>
         <ns1:incomeLevel>60000-70000</ns1:incomeLevel>
         <ns1:educationLevel>
            <ns3:value>post graduate</ns3:value>
         </ns1:educationLevel>
         <ns1:race>Asian</ns1:race>
         <ns1:dependents>4</ns1:dependents>
         <ns1:isSmoker>true</ns1:isSmoker>
         <ns1:hobbies>Fishing</ns1:hobbies>
         <ns1:interests>Reading</ns1:interests>
         <ns1:contactOrder>1984</ns1:contactOrder>
         <ns1:customAttributes>
            <ns3:customAttribute>
               <ns3:attribName>isprimary</ns3:attribName>
               <ns3:attribValues>
                  <ns3:attribValue>
                     <ns3:value>y</ns3:value>
                  </ns3:attribValue>
               </ns3:attribValues>
            </ns3:customAttribute>
         </ns1:customAttributes>
      </ns1:contactPerson>
   </contactPersons>
</customer>

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

     


JSON

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Content-Type application/json
Accept-Language en-US

Request body

{
    "id": "1000",   
    "contactPersons": {
        "contactPerson": [
            {
                "id": "1000",
                "salutation": "Mr.",
                "firstName": "John",
                "middleName": "Russel",
                "lastName": "Tierney",
                "gender": {
                    "value": "male"
                },
                "identification": {
                    "type": "Passport",
                    "value": "AE0000005"
                },
                "suffix": {
                    "value": "jr."
                },
                "initials": "A.",
                "secretQuestion": "Place of Birth",
                "secretAnswer": "Texas",
                "hasDirectMailingConsent": "true",
                "hasDirectCallingConsent": "true",
                "hasHoldingDataConsent": "true",
                "jobTitle": "Manager",
                "employmentStatus": {
                    "value": "intern"
                },
                "priority": "High",
                "dateOfBirth": "1965-12-09T00:00:00.000Z",
                "maritalStatus": {
                    "value": "married"
                },
                "type": {
                    "value": "Billing"
                },
                "firstNameFurigana": "John",
                "middleNameFurigana": "Russel",
                "lastNameFurigana": "Tierney",
                "startGreeting": "Welcome",
                "endGreeting": "Thanks, Byee",
                "spouseName": "Jenifer",
                "emergencyContact": "0987654321",
                "occupation": "Branch Manager",
                "incomeLevel": "60000-70000",
                "educationLevel": {
                    "value": "post graduate"
                },
                "race": "Asian",
                "dependents": "4",
                "isSmoker": "true",
                "hobbies": "Fishing",
                "interests": "Reading",
                "contactOrder": "1984",
                "customAttributes": {
                    "customAttribute": [
                        {
                            "attribName": "isprimary",
                            "attribValues": {
                                "attribValue": [
                                    {
                                        "value": "y"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json

     



Example 3 - Add new contact person for the customer

This example demonstrates the following:

  • Adding a new contact person, with all contact person attributes, for a group customer.

XML

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Content-Type application/xml
Accept-Language en-US

Request body

<customer xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer" 
xmlns:ns1="http://bindings.egain.com/ws/model/v12/gen/interaction/contactperson" 
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/platform" 
xmlns:ns3="http://bindings.egain.com/ws/model/v12/gen/common" 
xmlns:ns4="http://bindings.egain.com/ws/model/v12/gen/interaction/contactpoint" id='1000'>
   <contactPersons>
      <ns1:contactPerson>
         <ns1:salutation>Mr.</ns1:salutation>
         <ns1:firstName>John</ns1:firstName>
         <ns1:middleName>Russel</ns1:middleName>
         <ns1:lastName>Tierney</ns1:lastName>
        <ns1:preferredAgent id='1000'></ns1:preferredAgent>
         <ns1:gender>
            <ns3:value>Male</ns3:value>
         </ns1:gender>
         <ns1:identification>
            <ns1:type>Passport</ns1:type>
            <ns1:value>AE0000005</ns1:value>
         </ns1:identification>
         <ns1:suffix>
            <ns3:value>Jr.</ns3:value>
         </ns1:suffix>
         <ns1:initials>A.</ns1:initials>
         <ns1:secretQuestion>Place of Birth</ns1:secretQuestion>
         <ns1:secretAnswer>Texas</ns1:secretAnswer>
         <ns1:hasDirectMailingConsent>true</ns1:hasDirectMailingConsent>
         <ns1:hasDirectCallingConsent>true</ns1:hasDirectCallingConsent>
         <ns1:hasHoldingDataConsent>true</ns1:hasHoldingDataConsent>
         <ns1:jobTitle>Manager</ns1:jobTitle>
         <ns1:employmentStatus>
            <ns3:value>Intern</ns3:value>
         </ns1:employmentStatus>
         <ns1:priority>High</ns1:priority>
         <ns1:dateOfBirth>1965-12-09T00:00:00.000Z</ns1:dateOfBirth>
         <ns1:maritalStatus>
            <ns3:value>Married</ns3:value>
         </ns1:maritalStatus>
         <ns1:type>
            <ns3:value>Billing</ns3:value>
         </ns1:type>
         <ns1:firstNameFurigana>John</ns1:firstNameFurigana>
         <ns1:middleNameFurigana>Russel</ns1:middleNameFurigana>
         <ns1:lastNameFurigana>Tierney</ns1:lastNameFurigana>
         <ns1:startGreeting>Welcome</ns1:startGreeting>
         <ns1:endGreeting>Thanks, Byee</ns1:endGreeting>
         <ns1:spouseName>Jenifer</ns1:spouseName>
         <ns1:emergencyContact>0987654321</ns1:emergencyContact>
         <ns1:occupation>Branch Manager</ns1:occupation>
         <ns1:incomeLevel>60000-70000</ns1:incomeLevel>
         <ns1:educationLevel>
            <ns3:value>Post graduate</ns3:value>
         </ns1:educationLevel>
         <ns1:race>Asian</ns1:race>
         <ns1:dependents>4</ns1:dependents>
         <ns1:isSmoker>true</ns1:isSmoker>
         <ns1:hobbies>Fishing</ns1:hobbies>
         <ns1:interests>Reading</ns1:interests>
         <ns1:contactOrder>1984</ns1:contactOrder>
         <ns1:customAttributes>
            <ns3:customAttribute>
               <ns3:attribName>isprimary</ns3:attribName>
               <ns3:attribValues>
                  <ns3:attribValue>
                     <ns3:value>y</ns3:value>
                  </ns3:attribValue>
               </ns3:attribValues>
            </ns3:customAttribute>
         </ns1:customAttributes>
      </ns1:contactPerson>
   </contactPersons>
</customer>

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

     


JSON

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Content-Type application/json
Accept-Language en-US

Request body

{
    "id": "1000",    
    "contactPersons": {
        "contactPerson": [
            {               
                "salutation": "Mr.",
                "firstName": "John",
                "middleName": "Russel",
                "lastName": "Tierney",
                "preferredAgent": {
                    "id": "1000"
                },
                "gender": {
                    "value": "Male"
                },
                "identification": {
                    "type": "Passport",
                    "value": "AE0000005"
                },
                "suffix": {
                    "value": "Jr."
                },
                "initials": "A.",
                "secretQuestion": "Place of Birth",
                "secretAnswer": "Texas",
                "hasDirectMailingConsent": "true",
                "hasDirectCallingConsent": "true",
                "hasHoldingDataConsent": "true",
                "jobTitle": "Manager",
                "employmentStatus": {
                    "value": "Intern"
                },
                "priority": "High",
                "dateOfBirth": "1965-12-09T00:00:00.000Z",
                "maritalStatus": {
                    "value": "Married"
                },
                "type": {
                    "value": "Billing"
                },
                "firstNameFurigana": "John",
                "middleNameFurigana": "Russel",
                "lastNameFurigana": "Tierney",
                "startGreeting": "Welcome",
                "endGreeting": "Thanks, Byee",
                "spouseName": "Jenifer",
                "emergencyContact": "0987654321",
                "occupation": "Branch Manager",
                "incomeLevel": "60000-70000",
                "educationLevel": {
                    "value": "Post graduate"
                },
                "race": "Asian",
                "dependents": "4",
                "isSmoker": "true",
                "hobbies": "Fishing",
                "interests": "Reading",
                "contactOrder": "1984",
                "customAttributes": {
                    "customAttribute": [
                        {
                            "attribName": "isprimary",
                            "attribValues": {
                                "attribValue": [
                                    {
                                        "value": "y"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json

     



Example 4 - Add and edit contact points for the customer

This example demonstrates the following:

  • Editing all attributes of existing phone, postal and email type contact points of the customer.

XML

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Content-Type application/xml
Accept-Language en-US

Request body

<customer xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer"
xmlns:ns1="http://bindings.egain.com/ws/model/v12/gen/interaction/contactperson"
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/platform"
xmlns:ns3="http://bindings.egain.com/ws/model/v12/gen/common"
xmlns:ns4="http://bindings.egain.com/ws/model/v12/gen/interaction/contactpoint" id='1000'>
   <contactPersons>
      <ns1:contactPerson id='1000'>
         <ns1:contactPoints>
            <ns4:contactPoint id='1000'>
               <ns4:type>
                  <ns4:phone>
                     <ns4:type>
                        <ns3:value>home</ns3:value>
                     </ns4:type>
                     <ns4:phoneNo>234 3456</ns4:phoneNo>
                     <ns4:countryCode>1</ns4:countryCode>
                     <ns4:areaCode>408</ns4:areaCode>
                     <ns4:extension>102</ns4:extension>
                     <ns4:availability>
                        <ns4:days>
                           <ns3:value>any_day</ns3:value>
                        </ns4:days>
                        <ns4:times>
                           <ns3:value>mornings</ns3:value>
                        </ns4:times>
                     </ns4:availability>
                  </ns4:phone>
               </ns4:type>
               <ns4:priority>
                  <ns3:value>low</ns3:value>
               </ns4:priority>
               <ns4:customAttributes>
                  <ns3:customAttribute>
                     <ns3:attribName>prioritysequence</ns3:attribName>
                     <ns3:attribValues>
                        <ns3:attribValue>
                           <ns3:value>1</ns3:value>
                        </ns3:attribValue>
                     </ns3:attribValues>
                  </ns3:customAttribute>
               </ns4:customAttributes>
            </ns4:contactPoint>
            <ns4:contactPoint id='1001'>
               <ns4:type>
                  <ns4:postal>
                     <ns4:type>
                        <ns3:value>mailto</ns3:value>
                     </ns4:type>
                     <ns4:address_1>345</ns4:address_1>
                     <ns4:address_2>E Midfield Rd</ns4:address_2>
                     <ns4:city>Mountain View</ns4:city>
                     <ns4:state>CA</ns4:state>
                     <ns4:zip>98704</ns4:zip>
                     <ns4:country>USA</ns4:country>
                     <ns4:region>United States</ns4:region>
                  </ns4:postal>
               </ns4:type>
               <ns4:priority>
                  <ns3:value>low</ns3:value>
               </ns4:priority>
               <ns4:customAttributes>
                  <ns3:customAttribute>
                     <ns3:attribName>prioritysequence</ns3:attribName>
                     <ns3:attribValues>
                        <ns3:attribValue>
                           <ns3:value>2</ns3:value>
                        </ns3:attribValue>
                     </ns3:attribValues>
                  </ns3:customAttribute>
               </ns4:customAttributes>
            </ns4:contactPoint>
            <ns4:contactPoint id='1002'>
               <ns4:type>
                  <ns4:email>
                     <ns4:emailAddress>john_russel@gmail.com</ns4:emailAddress>
                  </ns4:email>
               </ns4:type>
               <ns4:priority>
                  <ns3:value>low</ns3:value>
               </ns4:priority>
               <ns4:customAttributes>
                  <ns3:customAttribute>
                     <ns3:attribName>prioritysequence</ns3:attribName>
                     <ns3:attribValues>
                        <ns3:attribValue>
                           <ns3:value>3</ns3:value>
                        </ns3:attribValue>
                     </ns3:attribValues>
                  </ns3:customAttribute>
               </ns4:customAttributes>
            </ns4:contactPoint>

         </ns1:contactPoints>
      </ns1:contactPerson>
   </contactPersons>
</customer>

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

     


JSON

Request

Method URL
PUT /ws/v12/interaction/customer

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Content-Type application/json
Accept-Language en-US

Request body

{
    "id": "1000",
    "contactPersons": {
        "contactPerson": [
            {
                "id": "1000",
                "contactPoints": {
                    "contactPoint": [
                        {
                            "id": "1000",
                            "type": {
                                "phone": {
                                    "type": {
                                        "value": "home"
                                    },
                                    "phoneNo": "234 3456",
                                    "countryCode": "1",
                                    "areaCode": "408",
                                    "extension": "102",
                                    "availability": {
                                        "days": {
                                            "value": "any_day"
                                        },
                                        "times": {
                                            "value": "mornings"
                                        }
                                    }
                                }
                            },
                            "priority": {
                                "value": "low"
                            },
                            "customAttributes": {
                                "customAttribute": [
                                    {
                                        "attribName": "prioritysequence",
                                        "attribValues": {
                                            "attribValue": [
                                                {
                                                    "value": "1"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "id": "1001",
                            "type": {
                                "postal": {
                                    "type": {
                                        "value": "mailto"
                                    },
                                    "address_1": "345",
                                    "address_2": "E Midfield Rd",
                                    "city": "Mountain View",
                                    "state": "CA",
                                    "zip": "98704",
                                    "country": "USA",
                                    "region": "United States"
                                }
                            },
                            "priority": {
                                "value": "low"
                            },
                            "customAttributes": {
                                "customAttribute": [
                                    {
                                        "attribName": "prioritysequence",
                                        "attribValues": {
                                            "attribValue": [
                                                {
                                                    "value": "2"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "id": "1002",
                            "type": {
                                "email": {
                                    "emailAddress": "john_russel@gmail.com"
                                }
                            },
                            "priority": {
                                "value": "low"
                            },
                            "customAttributes": {
                                "customAttribute": [
                                    {
                                        "attribName": "prioritysequence",
                                        "attribValues": {
                                            "attribValue": [
                                                {
                                                    "value": "3"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Response
HTTP/1.1 204 No Content

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json