Skip to content

Date Shift

See Date Shift for more information about this algorithm framework.

Creating a Date Shift Algorithm via API

  1. Retrieve the frameworkId for the Date Shift Framework. This information can be retrieved using the following endpoint:

    algorithm   GET /algorithm/frameworks
    

    The framework information should look similar to the following:

    {
        "frameworkId": 5,
        "frameworkName": "Date Shift",
        "frameworkType" : "LOCAL_DATE_TIME",
        "plugin" :
        {
            "pluginId" : 7,
            "pluginName" : "dlpx-core"
        }
    }
    
  2. Create a Date Shift algorithm via the following endpoint:

    algorithm   POST /algorithms
    

    Configure a new algorithm using the JSON formatted input similar to the following:

    {
        "algorithmName": "exampleDateShiftAlgorithm",
        "algorithmType": "COMPONENT",
        "frameworkId" : 5,
        "algorithmExtension" :
        {
            "minRange" : -3,
            "maxRange" : 3,
            "unit": "MINUTES",
            "roll": "false"
        }
    }
    

Date Shift Algorithm Extension

  • minRange

    Integer
    A number representing the minimum range value from the input that the input can mask to. The range is inclusive of this value and must be an integer value. Negative values represent units of time in the past and positive values represent units of time in the future. Zero may be included in the range or as one of the range values, but the input will not mask to the same value.

  • maxRange

    Integer
    A number representing the maximum range value from the input that the input can mask to. The range is inclusive of this value and must be an integer value. Negative values represent units of time in the past and positive values represent units of time in the future. Zero may be included in the range or as one of the range values, but the input will not mask to the same value.

  • unit (default="DAYS")

    String
    A unit of time that determines what the range is expressed in. Only one unit of time can be specified for each algorithm created. Masked values will be returned with the same granularity as the specified unit. For example a range of 1-2 days will not return the same masked values as a range of 24-48 hours as a range of 1-2 days will return a value with the hours, minutes, and seconds intact but a range of 24-48 hours may return a value with a change in hours anywhere from 24 hours to 48 hours. Unit options supported by this framework: years, months, days, hours, minutes, and seconds.

  • roll (default="false")

    String
    A boolean that represents whether or not the specified time unit should roll which means that units of time larger and smaller than the specified unit will remain the same. When set to false, there is no guarantee that larger units of time remain the same. When set to true, all larger units of time will retain their same values and the specified unit may wrap around to the beginning. For example, a date at the end of March may wrap around to the beginning of March while keeping all larger units of time and smaller units of time intact. Unit options supported by this framework: months, days, hours, minutes, and seconds.