Overview

Skill Level: Any

Use this procedure to import Watson Campaign Automation data into WMI to enable you to explore the data and predict customer behavior.

Prerequisites

To complete this procedure, you need your WMI API Key, your WCA Pod number, WCA OAuth refresh token, the WCA database ID, and the list of columns you want to import.

Step-by-step

  1. Identify the neccesary WMI and WCA configuration values

    Find the following values. You will need these values to complete this tutorial.

     

    Value Description
    WMI API key This was provided when you were provisioned for WMI. For more information about managing your API keys, see How to create and manage API keys.
    WCAPod The pod associated with your user account. Currently this will be a value between 1 and 8. For more information on pods, see Pod information for setting up an FTP or SFTP account.
    WCARefreshToken The OAUTH refresh token issued by the WCA system for access to the WCA APIs. Refer to Getting Refresh Tokens for more information.
    WCADatabaseId The numeric identifier of a WCA database. Get this information by opening your instance of WCA and hovering over the database name.
    wcaInputColumns The array of columns in WCA to be imported into WMI. This is an optional parameter. You do not need to provide the WCA keys. They will be included automatically.
  2. Configuring WCA import parameters using the WMI Configuration API service

    1. Set the connection parameters:

    • WCAPod
    • WCARefreshToken
    curl -X PATCH -–header 'Content-Type: application/json' 
    -–header 'Accept: application/json'
    --header 'Authorization: APIKey yourapikeyvalue'
    -d '{ \"value": 2 \}' 'https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/config/WCAPod'
    curl -X PATCH -–header 'Content-Type: application/json' 
    -–header 'Accept: application/json'
    --header 'Authorization: APIKey yourapikeyvalue'
    -d '{ \"value": WCARefreshTokenValue \}' 'https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/config/WCARefreshToken'

     

    2. Select a database using WCADatabaseId.

    For example:

    curl -X PATCH -–header 'Content-Type: application/json' 
    -–header 'Accept: application/json'
    --header 'Authorization: APIKey yourapikeyvalue'
    -d '{ \"value": WCADatabaseIdvalue \}' 'https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/config/WCADatabaseId'

     

    3. Identify the wcaInputColumns to import.

    For example:

    curl -X PATCH -–header 'Content-Type: application/json' 
    -–header 'Accept: application/json'
    --header 'Authorization: APIKey yourapikeyvalue'
    -d '{ \"value":["col1","col2","col3",…]\}' 'https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/config/wcaInputColumns'

     

    You can use any columns available in your WCA data set. In the case where the WCA column names are already in use in WMI, the imported WCA column names are altered using the following rules:

    1. If you have a column that is a WMI business key such as CUSTOMER_NO or PERIOD_START_DATE, a 2 is added as a suffix such as CUSTOMER_NO2.
    2. If you have a WMI model outputs, such as SEGMENT_NAME, a 2 is added as a suffix, such as SEGMENT_NAME2.

    If there are columns in WCA that use non-alphanumerics (such as !@#$%), the non alphanumerics like are replaced with an underscore for each character.

  3. Import WCA data

    Import WCA email events and profile attributes one period at a time using the Import API. The message body must specify WCA as the source type and optionally provide a start date for extracting event history. If a start date is specified, it can be no further in the past than 6 periods for trial users and 13 for paid/beta users. Loading starts from the start date up to the current period. If no date is specified, loading begins at the appropriate period as defined by the following rules:

    • If no data exists in WMI, loading begins between 6 and 13 periods back: 6 for trial users, 13 for paid customers and beta customers. Periods up the current period are loaded.
    • If data has been previously imported, the import will pick up at the next period and load up to the current period.
    • If invoked more than once in a period, import will reload from the start of the period to the current date.

    Here is an example command:

    curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: APIKey yourapikeyvalue' -d
    '{
    "mode": "merge",
    "source": {
    "type": "WCA",
    "startDate": "yyyy-mm-dd"
    }
    }' 'https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import'

    Always import the data in chronological order so that levels of engagement can be calculated accurately across time. The WCA APIs do not permit WMI access to Private mailings not owned by the user calling the API. They will not be included in the events shared between the two systems.

Expected outcome

Initially, an Engagement model is run on imported data for WMI Essentials and Standard editions.

For additional models, such as attrition, CLTV and pulse analysis, WMI standard edition is required. Refer to Adding additional behavior models to imported WCA data.

Join The Discussion

Your email address will not be published. Required fields are marked *