Describe Customer
Updates information about a Customer object in Kustomer.
You can add attributes to the current Customer object (either a logged-in customer or an anonymous customer)
val attributes = KusCustomerDescribeAttributes(
sharedEmails = listOf(KusEmail(value)),
sharedPhones = listOf(KusPhone(value)),
sharedSocials = listOf(KusSocial(value, KusSocialType.twitter))
custom = mutableMapOf(key to value)
)
val result = Kustomer.getInstance().describeCustomer(attributes)
when (result) {
is KusResult.Success -> //Success
is KusResult.Error -> //Error
}
Describe Customer attributes
A list of all standard Customer klass attributes for KusCustomerDescribeAttributes
:
KusCustomerDescribeAttributes(
sharedEmails = listOf(KusEmail(value)),
sharedPhones = listOf(KusPhone(value)),
sharedSocials = listOf(
KusSocial(value, KusSocialType.twitter),
KusSocial(value, KusSocialType.facebook),
KusSocial(value, KusSocialType.instagram),
KusSocial(value, KusSocialType.linkedin)
),
custom = mutableMapOf(key to value)
)
Note:
phones
,emails
, andsocials
deprecatedAs of
3.3.1
thephones
,emails
, andsocials
fields have been deprecated in favor ofsharedPhones
,sharedEmails
, andsharedSocials
. These fields behave the same, but more accurately represent the fields they update.
phones
,emails
, andsocials
will continue to work, but may be removed in a future version.
Use custom attribute values
You can also send the SDK custom attribute values for custom attributes enabled in Kustomer.
Always use the attribute name instead of the Display Name listed in the Klasses editor (Settings > Platform > Klasses) in Kustomer. The attribute name will always be formatted in camelCase or PascalCase without spaces and also describes the data type for the attribute.
For example, if a custom attribute has a Display Name of "Avg Sat Score" and has a number data type, then the name may appear as AvgSatScoreNum
. You would use AvgSatScoreNum
, the system name for the custom attribute, with the SDK.
Activate custom attributes for the Customer klass
To update custom attributes, ensure you have the custom attribute key-value pairs activated for the Customer klass on the Kustomer platform. To edit or view custom attributes for the Customer klass, go to Settings and select Platform > Klasses > Customer.
To learn more, see Define custom attribute in Kustomer in the Kustomer Help Center.
Convert multi-level list (mll, or tree) attribute values to lowercase
Convert multi-level list style attribute values to lowercase
For example, if you have a multi-level list attribute value of
Level11
, convert the value tolevel11
for use with the SDK. All value for multi-level list attributes are stored in lowercase on the backend.
Updated about 1 month ago