getCustomerData Method

This optional method call is called by the toolbar to perform reverse lookup operations during a communication life cycle.

Here's the parameters for this method:

Parameter

Description

channel

Name of the channel for which the method is called.

appClassification

Name of the application classification defined for the current toolbar. If this parameter is passed as null, it's assumed that there is no application classification. For a list of preconfigured values, see Application Classification Code.

eventId

A toolbar generated media event identifier. The same parameter value must be used for all method invocations for a communication. This parameter is stored with internal interaction record.

inData

An object containing information about incoming events for customer identifiable data, along with attributes containing the names of system or user-defined defined tokens.

lookupObject

The business object used to run the reverse lookup. This parameter is optional and a default value of Contact is used for customer information. For more information about the list of system lookup objects, see System Business Objects.

callback

Returns results to the caller toolbar.

channelType

The type of channel for which the method is being called. Note that if, for example, the channel is PHONE but the channelType isn't provided, the default value is set to ORA_SVC_PHONE. For more information, see Channel Type Data.

The following table shows a list of member attributes of the response object. The object has no return value.

Member Attribute

Description

result

The server side running status. Result values are success or error.

outData

An object containing possible identified data from Fusion Service for the contact or organization. This attribute contains the names of system tokens.

error

Contains error message if the result value is an error. If not, then the value is undefined. For more information about error message codes, see Error Messages.

Here's sample code for this method:

<html>
<head>
<script type="text/javascript" src="http://domain:port/ora_support/js/mcaInteractionV1.js"> 
</script>
<script type="text/javascript">
function getCustomerData() {
      var inData = {};
      inData.SVCMCA_ANI = '5551234';
      inData.SVCMCA_CONTACT_ID = '1234567890';
      svcMca.tlb.api.getCustomerData('PHONE', 'ORA_SERVICE', '12345-1234-67890', inData, null, function (response) {
        if (response.result == 'success') {
          console.log('Customer: '+response.outData.SVCMCA_CONTACT_NAME +' ('+response.outData.SVCMCA_CONTACT_ID +')');
          console.log('Account:'+response.outData.SVCMCA_ORG_NAME+'('+response.outData.SVCMCA_ORG_ID+')');
          alert('Success! Results available in log.');
        } else {
          alert('Operation finished with error: ' + response.error);
        }
      },'ORA_SVC_PHONE');
    }</script>
</head>
<body>
<input type="button" value="Get customer data" onclick="getCustomerData()"/>
</body>
</html>