All Classes Pages
CreateIndividualCustomerExamples Class Reference

More...

Detailed Description

Examples for Create Individual Customer

Example 1 - Create customer with required elements

This example demonstrates the following:

  • Creating an individual customer by providing only the required elements.
  • This example assumes that the "Customer departmentalization" setting is disabled, and hence, department is not a required attribute.

XML

Request

Method URL
POST /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" >
	<type>
		<value>individual</value>
	</type>
	<contactPersons>
		<ns1:contactPerson>
			<ns1:firstName>Jack</ns1:firstName>
		</ns1:contactPerson>
	</contactPersons>
</customer>

Response
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml
Location /system/ws/v12/interaction/customer/2801

     


JSON

Request

Method URL
POST /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

{
    "type": {
        "value": "individual"
    },
    "contactPersons": {
        "contactPerson": [
            {
                "firstName": "Jack"
            }
        ]
    }
}

Response
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json
Location /system/ws/v12/interaction/customer/2802

     



Example 2 - Create customer with all elements

This example demonstrates the following:

  • Creating a individual customer with all elements
  • Creating contact point of all types.
  • This example assumes that the "Customer departmentalization" setting is enabled, and hence, this example also shows the representation of department in the request.

XML

Request

Method URL
POST /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

<?xml version="1.0" encoding="UTF-8"?>
<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">
   <department>
      <ns2:name>Service</ns2:name>
   </department>
   <type>
      <value>individual</value>
   </type>
   <level>
      <ns3:value>Premium</ns3:value>
   </level>
   <role>
      <ns3:value>Partner</ns3:value>
   </role>
   <pin>0121</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>
   <contactPersons>
      <ns1:contactPerson>
         <ns1:salutation>Mr.</ns1:salutation>
         <ns1:firstName>John</ns1:firstName>
         <ns1:middleName>Russel</ns1:middleName>
         <ns1:lastName>Tierney</ns1:lastName>
        <ns1:loginId>john</ns1:loginId>
         <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:contactPoints>
            <ns4:contactPoint>
               <ns4:type>
                  <ns4:value>phone</ns4:value>
                  <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>high</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>
               <ns4:type>
                  <ns4:value>postal</ns4:value>
                  <ns4:postal>
                     <ns4:type>
                        <ns3:value>office</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>
               <ns4:type>
                  <ns4:value>email</ns4:value>
                  <ns4:email>
                     <ns4:emailAddress>john.russel@customer.com</ns4:emailAddress>
                  </ns4:email>
               </ns4:type>
               <ns4:priority>
                  <ns3:value>medium</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 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml
Location /system/ws/v12/interaction/customer/2803

     


JSON

Request

Method URL
POST /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

{
    "department": {
        "name": "Service"
    },
    "type": {
        "value": "individual"
    },
    "level": {
        "value": "Premium"
    },
    "role": {
        "value": "Partner"
    },
    "pin": "0121",
    "howReferred": {
        "value": "Customer"
    },
    "industry": {
        "value": "Telecom"
    },
    "marketSegment": "Medical Products",
    "entitlements": "Free service",
    "customAttributes": {
        "customAttribute": [
            {
                "attribName": "preferredlang",
                "attribValues": {
                    "attribValue": [
                        {
                            "value": "English"
                        }
                    ]
                }
            }
        ]
    },
    "contactPersons": {
        "contactPerson": [
            {
                "salutation": "Mr.",
                "firstName": "John",
                "middleName": "Russel",
                "lastName": "Tierney",
                "loginId": "john",
                "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"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "contactPoints": {
                    "contactPoint": [
                        {
                            "type": {
                                "value": "phone",
                                "phone": {
                                    "type": {
                                        "value": "home"
                                    },
                                    "phoneNo": "234 3456",
                                    "countryCode": "1",
                                    "areaCode": "408",
                                    "extension": "102",
                                    "availability": {
                                        "days": {
                                            "value": "any_day"
                                        },
                                        "times": {
                                            "value": "mornings"
                                        }
                                    }
                                }
                            },
                            "priority": {
                                "value": "high"
                            },
                            "customAttributes": {
                                "customAttribute": [
                                    {
                                        "attribName": "prioritysequence",
                                        "attribValues": {
                                            "attribValue": [
                                                {
                                                    "value": "1"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "type": {
                                "value": "postal",
                                "postal": {
                                    "type": {
                                        "value": "office"
                                    },
                                    "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"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "type": {
                                "value": "email",
                                "email": {
                                    "emailAddress": "john.russel@customer.com"
                                }
                            },
                            "priority": {
                                "value": "medium"
                            },
                            "customAttributes": {
                                "customAttribute": [
                                    {
                                        "attribName": "prioritysequence",
                                        "attribValues": {
                                            "attribValue": [
                                                {
                                                    "value": "3"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Response
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json
Location /system/ws/v12/interaction/customer/2804