How to do web call back

How to do web call back


Introduction

This article gives an overview on how to use the Nixxis “ContextData” interface to do a web “Call me back”. 

Definition

There are 2 types of call me back. The first is the “Call me back now” and the second is the “Call me back at”. The main difference between the 2 is that the second have a callback date/time.
For both types it is needed to have a campaign with an outbound activity. 

Create a new record

To create a new record the Nixxis API “ContextData” will be used.  
The action “CreateContextData” allow to create a new record in the “Data” table of the campaign (see documentation about “ContactData” for more details). This will also trigger the creation of a record in the “SystemData” table. 


There are 2 different type of record that can be created: 
  1. A record for the campaign (see “Campaign Record”). 
  2. A record that is directly associated with an activity (see “Record associated to an activity”) 

Campaign record 

The first way is to create a record that can be handled by any activity of the campaign.  
For this a POST of xml data is need to the Nixxis ContextData service, this uri looks like this: 
 
http://appserver.nixxis.com:8088/data?action=CreateContextData&context={campaignId}
 

Using the following parameters: 
  1. “appserver.Nixxis.com:8088”: the name or ip and port of appserver that is used for the “Call me back” 
  2. {campaignId}: the guid of the campaign that will be used for the “Call me back”. Example: 38e8f8dfgg4fd5g1dfg8df4g618g

Here is how the XML structure should look like:  
contextdata> 
            <campaigndata> 
                        <Name>My Customer Name</Name> 
                        <PhoneNumber>0123456789</PhoneNumber> 
            </campaigndata> 
            <systemdata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <CurrentActivity xsi:nil="true" />
                         <State>15</State>
                         <SortInfo>-2</SortInfo>
                         <DialStartDate>yyyy-MM-dd hh:mm:ss.000</DialStartDate>
                         <DialEndDate>yyyy-MM-dd hh:mm:ss.000</DialEndDate>
                         <CreationTime>yyyy-MM-dd hh:mm:ss.000</CreationTime>
                         <ImportTag>ImportTag</ImportTag>
            </systemdata>
</contextdata> 

Info
  1. The tags under ‘<campaigndata>’ (‘<Name>’ and ‘<PhoneNumber>’ in this sample) are directly linked to the fields defined in the campaign database structure. And can be different for each campaign. 
  2. Respect the casing of the fields.
  3. CurrentActivity = Empty (type: char(32)
  4. State = 15 (state description: Callback | type: int)
  5. DialStartDate = Callback date (type: datetime)
  6. DialEndDate = Callback end validity date (type: datetime)
  7. CreationTime = Optional (type: datetime)
  8. ImportTag = Optional (type: nvarchar(250))

Record associated to an activity 

The seconded way is a record that is associated with an activity. 
For this a POST of xml data is need to the Nixxis ContextData service, this uri looks like this: 

http://appserver.nixxis.com:8088/data?action=CreateContextData


Using the following parameters: 
  1. “appserver.Nixxis.com:8088”: the name or ip and port of appserver that is used for the “Call me back.” 
  2. The phone number is always required and need to be put in 1 of the fields where the field meaning is set to a phone number. 

Here is how the XML structure should look like:  
<contextdata> 
            <campaigndata> 
                        <Name>My Customer Name</Name> 
                        <PhoneNumber>0123456789</PhoneNumber> 
            </campaigndata> 
            <systemdata>
                        <CurrentActivity>47b8f8ead10d45c7ac2331c5b47a48b8</CurrentActivity>
                         <State>15</State>
                         <SortInfo>-2</SortInfo>
                         <DialStartDate>yyyy-MM-dd hh:mm:ss.000</DialStartDate>
                         <DialEndDate>yyyy-MM-dd hh:mm:ss.000</DialEndDate>
                         <CreationTime>yyyy-MM-dd hh:mm:ss.000</CreationTime>
                         <ImportTag>ImportTag</ImportTag>
            </systemdata>
</contextdata> 

Info
  1. The tags under ‘<campaigndata>’ (‘<Name>’ and ‘<PhoneNumber>’ in this sample) are directly linked to the fields defined in the campaign database structure. And can be different for each campaign. 
  2. Respect the casing of the fields.
  3. CurrentActivity = 47b8f8ead10d45c7ac2331c5b47a48b8 (to be replaced with destination activity | type: char(32)
  4. State = 15 (state description: Callback | type: int)
  5. DialStartDate = Callback date (type: datetime)
  6. DialEndDate = Callback end validity date (type: datetime)
  7. CreationTime = Optional (type: datetime)
  8. ImportTag = Optional (type: nvarchar(250))

Example Postman :

https://documenter.getpostman.com/view/1896556/2s93RZL987