Skip to content

Touchpoint Studio

Intro Steps

The first step to start with Touchpoints through API is to access the API documentation on the link: Touchpoint Studio API and it looks something like this:

Header parameters
Name Value Description
Authorization
required
Bearer Token is retriveing called Auth API
Content Type
required
application/json

Strategies

In Touchpoint Studio, there is a main component called a strategy that is used to define what will be shown to the end-user. If the end-user is part of a specific audience, this strategy will be applied. Strategies are directly connected with the type, subtype, and goal of the specific strategy. Also, important part of the strategy are rules and its types:

  1. random-products,
  2. selected-products ,
  3. best-sellers,
  4. most-viewed-products,
  5. trending-products,
  6. trending-products-interactions,
  7. most-recommended-products,
  8. most-recommended-products-interactions,
  9. merchandise-rules,
  10. similar-products,
  11. similar-products-ai,
  12. related-products,
  13. related-products-ai,
  14. ai-community-based,
  15. ai-community-based-interactions,
  16. time-based,
  17. time-based-interactions,
  18. history-based,
  19. history-based-interactions,
  20. ai-next-gen,
  21. ai-description-based,
  22. ai-search
  23. discount-leaflet
  24. ai-attribute-based-leaflet

Strategies can be: - default - merchandise-rules - selected-products - random-products - best-sellers - most-viewed-products - trending-products - trending-products-interactions - most-recommended-products - most-recommended-products-interactions - additional - all strategies can be additional

  • NOTE: When creating smart-search type of strategy, you will only need ai-search strategy and it’s the only one which can be used with this type of Touchpoint

Get strategies

You can see the list of strategies by calling the endpoint below.

curl -x GET "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies"
  {
     "offset":0,
     "limit":10,
     "strategies":[
        {
           "strategy_name":"Wheel of fortune Campaigning",
           "strategy_type":"wheel-of-fortune",
           "strategy_subtype":"wheel-of-fortune",
           "strategy_goal":"boost-chosen-products-for-Buzz",
           "author":"pytest",
           "is_draft":false,
           "is_active":false,
           "audiences":[
              "all_customers"
           ],
           "is_general_filter":false,
           "is_default":true,
           "product_hierarchy_level_id":"discount-leaflet",
           "product_hierarchy_level_value":"leaflet-id-1",
           "rules":[
              {
                 "rule_type":"discount-leaflet",
                 "positions":[
                    0
                 ],
                 "values":[
                    {
                       "comparator":"=",
                       "value":"discount-id-1",
                       "column_name":"discount_id"
                    }
                 ]
              },
              {
                 "rule_type":"discount-leaflet",
                 "positions":[
                    1
                 ],
                 "values":[
                    {
                       "comparator":"=",
                       "value":"discount-id-2",
                       "column_name":"discount_id"
                    }
                 ]
              },
              {
                 "rule_type":"discount-leaflet",
                 "positions":[
                    2
                 ],
                 "values":[
                    {
                       "comparator":"=",
                       "value":"discount-id-3",
                       "column_name":"discount_id"
                    }
                 ]
              },
              {
                 "rule_type":"discount-leaflet",
                 "positions":[
                    3
                 ],
                 "values":[
                    {
                       "comparator":"=",
                       "value":"discount-id-4",
                       "column_name":"discount_id"
                    }
                 ]
              },
              {
                 "rule_type":"discount-leaflet",
                 "positions":[
                    4
                 ],
                 "values":[
                    {
                       "comparator":"=",
                       "value":"discount-id-5",
                       "column_name":"discount_id"
                    }
                 ]
              }
           ],
           "audience_count":719303,
           "strategy_id":"strategy-id-c0e377a25e224997b4418913ea6497ab",
           "date_created":"2023-09-12T15:02:22",
           "date_modified":"2023-09-12T15:02:22",
           "is_ready":false
        }
     ],
     "count":1
  }

Signle strategy

In case you want to return single, exact stretegy, use next example: https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies/strategy-id-c0e377a25e224997b4418913ea6497ab

Create strategy

You can create simple strategy with next request:

POST https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies

Next strategy will have default type and it will be random-product that is used with 5 slots:

curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies"

  '{
     "strategy_name":"Smart Recommender Random Products General",
     "strategy_type":"smart-recommender",
     "strategy_subtype":"carousel",
     "strategy_goal":"boost-chosen-products",
     "author":"pytest",
     "is_draft":false,
     "is_general_filter":true,
     "is_default":true,
     "audiences":[
        "all_customers"
     ],
     "product_hierarchy_level_id":"",
     "product_hierarchy_level_value":"",
     "rules":[
        {
           "rule_type":"random-products",
           "positions":[
              0,
              1,
              2,
              3,
              4
           ],
           "values":[

           ]
        }
     ]
  }'
  {
     "strategy_name":"Smart Recommender Random Products General",
     "strategy_type":"smart-recommender",
     "strategy_subtype":"carousel",
     "strategy_goal":"boost-chosen-products",
     "author":"pytest",
     "is_draft":false,
     "is_active":false,
     "audiences":[
        "all_customers"
     ],
     "is_general_filter":true,
     "is_default":true,
     "product_hierarchy_level_id":"",
     "product_hierarchy_level_value":"",
     "rules":[
        {
           "rule_type":"random-products",
           "positions":[
              0,
              1,
              2,
              3,
              4
           ],
           "values":[

           ]
        }
     ],
     "strategy_id":"strategy-id-12166698047243da9326e30a440886af",
     "is_ready":false,
     "audience_count":719303,
     "date_created":"2023-09-13T09:34:08",
     "date_modified":"2023-09-13T09:34:08"
  }

Update strategy

You can edit strategy with PUT request like this:

  curl -X PUT "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies/strategy-id-12166698047243da9326e30a440886af"

     '{
        "strategy_name":"Smart Recommender Random Products General EDITED",
        "strategy_type":"smart-recommender",
        "strategy_subtype":"carousel",
        "strategy_goal":"boost-chosen-products",
        "author":"pytest",
        "is_draft":false,
        "is_general_filter":true,
        "is_default":true,
        "audiences":[
           "all_customers"
        ],
        "product_hierarchy_level_id":"",
        "product_hierarchy_level_value":"",
        "rules":[
           {
              "rule_type":"random-products",
              "positions":[
                 0,
                 1,
                 2,
                 3,
                 4
              ],
              "values":[

              ]
           }
        ]
     }'
  {
     "strategy_name":"Smart Recommender Random Products General EDITED",
     "strategy_type":"smart-recommender",
     "strategy_subtype":"carousel",
     "strategy_goal":"boost-chosen-products",
     "author":"pytest",
     "is_draft":false,
     "is_active":false,
     "audiences":[
        "all_customers"
     ],
     "is_general_filter":true,
     "is_default":true,
     "product_hierarchy_level_id":"",
     "product_hierarchy_level_value":"",
     "rules":[
        {
           "rule_type":"random-products",
           "positions":[
              0,
              1,
              2,
              3,
              4
           ],
           "values":[

           ]
        }
     ],
     "strategy_id":"strategy-id-12166698047243da9326e30a440886af",
     "is_ready":false,
     "audience_count":719303,
     "date_created":"2023-09-13T09:34:08",
     "date_modified":"2023-09-13T09:36:08"
  }

Update condition

It is not possible to edit the strategy if it is not ready (is_ready:True)

Delete strategy

Strategy can be deleted with simple DELETE request

  curl -X DELETE "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies/strategy-id-12166698047243da9326e30a440886af"
  {
     "detail": "Strategy deleted successfully"
  }

Update condition

It is not possible to delete a strategy if there is a touchpoint associated with this strategy, first delete the touchpoint and then the strategy

Positions

Positions are specific for each Touchpoint. With the integration of this studio, you get those that are predefined and you can retrieve them all on the next endpoint:

Get all positions

  curl -X GET "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/position"
  {
     "offset": 0,
     "limit": 10,
     "positions": [
        {
           "position_name": "On my Home Page",
           "position_description": "show this touchpoint on my home page edited",
           "position_id": "position-id-f0e27eb8f11a4fd88afd58e78d43a6fa"
        }
     ],
     "count": 1
  }

Create position

Adding new positions is simple:

  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/positions"
  '{
     "position_name": "On my Landing Page",
     "position_description": "show this touchpoint on my landing page"
  }'
  {
     "position_name":"On my Landing Page",
     "position_description":"show this touchpoint on my home landing page",
     "position_id":"position-id-4d88779b48f146028af746a343f2bc13"
  }

Update position

It’s possible to update position name and description within next request

  curl -X PUT "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/positions/position-id-4d88779b48f146028af746a343f2bc13"
  '{
     "position_name":"On my Checkout Page",
     "position_description":"show this touchpoint on my home checkout page"
  }'
  {
     "position_name":"On my Checkout Page",
     "position_description":"show this touchpoint on my home checkout page",
     "position_id":"position-id-4d88779b48f146028af746a343f2bc13"
  }

Delete position

Position can be deleted with simple DELETE request:

  curl -X DELETE "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/positions/position-id-4d88779b48f146028af746a343f2bc13"
  {
     "detail": "Position deleted successfully"
  }

Delete condition

It is not possible to delete a position if there is a touchpoint associated with this position, first delete the touchpoint and then the position.

Touchpoints

You can create three types of touchpoints:

  • smart-search created with one strategy that has the rule type ai-search. It is ready for immediate use
  • smart-recommender created with at least one default strategy, while more strategies can be added to the strategies field by priority
  • wheel-of-fortune similar to smart recommender with additional configuration

Get all touchpoints

You can see the list of touchpoints by calling the endpoint:

  curl -X GET "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/touchpoints"
  {
     "offset":0,
     "limit":10,
     "touchpoints":[
        {
           "touchpoint_name":"Touchpoint Wheel of Fortune EDITED",
           "touchpoint_type":"wheel-of-fortune",
           "touchpoint_subtype":"wheel-of-fortune",
           "author":"pytest",
           "channel":"Channel",
           "position":"position-id-3cce003da850483c9479eaa89bba5a28",
           "is_active":false,
           "is_draft":false,
           "number_of_positions":5,
           "default_strategy":"strategy-id-c0e377a25e224997b4418913ea6497ab",
           "strategies":[

           ],
           "touchpoint_id":"touchpoint-id-ff36863624294a1191825423e4266145",
           "date_created":"2023-09-12T15:03:07",
           "date_modified":"2023-09-12T15:03:07",
           "is_using_fallback":false,
           "is_calculating":false,
           "is_ready":false
        }
     ],
     "count":1
  }

Adding touchpoint_id at the end of previous request, response will contain only data for requested touchpoint.

Create touchpoints

Create Smart Search touchpoint

  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies"
  {
     "strategy_name":"Smart Search Touchpoint default strategy",
     "strategy_type":"smart-search",
     "strategy_subtype":"search-bar",
     "strategy_goal":"decrease-time-to-buy-for-Dev",
     "author":"Violeta",
     "is_draft":false,
     "is_general_filter":true,
     "is_default":true,
     "audiences":[
        "all_customers"
     ],
     "product_hierarchy_level_id":"",
     "product_hierarchy_level_value":"",
     "rules":[
        {
           "rule_type":"ai-search",
           "positions":[

           ],
           "values":[
              {
                 "comparator":"=",
                 "value":"Dev",
                 "column_name":"tenant_id"
              },
              {
                 "comparator":"=",
                 "value":"item_id,item_name,product_price,additional_item_data",
                 "column_name":"filter_columns"
              },
              {
                 "comparator":"=",
                 "value":5,
                 "column_name":"limit"
              },
              {
                 "comparator":"=",
                 "value":38,
                 "column_name":"match_score"
              }
           ]
        }
     ]
  }

Then, create smart-search Touchpoint with previous strategy:

  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/touchpoints"
  {
     "touchpoint_name":"Smart Search Touchpoint",
     "touchpoint_type":"smart-search",
     "touchpoint_subtype":"search-bar",
     "author":"Violeta",
     "channel":"Website",
     "position":"position-id-43b025df01564b4aa4c4a7b93db4a712",
     "default_strategy":"strategy-id-054936f2098f44afa039c3ceee2f7c03",
     "number_of_positions":0,
     "is_draft":false
  }
  {
     "touchpoint_name":"Smart Search Touchpoint",
     "touchpoint_type":"smart-search",
     "touchpoint_subtype":"search-bar",
     "author":"Violeta",
     "channel":"Website",
     "position":"position-id-43b025df01564b4aa4c4a7b93db4a712",
     "is_active":false,
     "is_draft":false,
     "number_of_positions":0,
     "default_strategy":"strategy-id-054936f2098f44afa039c3ceee2f7c03",
     "strategies":[

     ],
     "touchpoint_id":"touchpoint-id-02f2e8ac6967417b8173a2384103496c",
     "is_ready":true,
     "is_calculating":true,
     "is_using_fallback":false,
     "date_created":"2023-09-13T11:10:38",
     "date_modified":"2023-09-13T11:10:38"
  }

You can test it with the next route:

  curl -X GET "https://dev.thingsolver.com/api/latest/touchpoint-studio/touchpoints/touchpoint-id-02f2e8ac6967417b8173a2384103496c/content?term=Mleko"
  '{
     "touchpoint_name":"Smart Search Touchpoint",
     "touchpoint_type":"smart-search",
     "touchpoint_subtype":"search-bar",
     "author":"Violeta",
     "channel":"Website",
     "position":"position-id-43b025df01564b4aa4c4a7b93db4a712",
     "default_strategy":"strategy-id-054936f2098f44afa039c3ceee2f7c03",
     "number_of_positions":0,
     "is_draft":false
  }'
  {
     "touchpoint_id":"touchpoint-id-02f2e8ac6967417b8173a2384103496c",
     "touchpoint_type":"smart-search",
     "offset":0,
     "limit":5,
     "count":20,
     "content":[
        {
           "alternative_id":null,
           "item_id":"itm_9079",
           "product_url":"?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-02f2e8ac6967417b8173a2384103496c&UTM_TPST=smart-search",
           "original_price":0.0,
           "date_added":"",
           "images":[

           ],
           "is_active":true,
           "main_image":"",
           "item_name":"Fortunately, milk...",
           "alternative_name":"",
           "simple_name":"",
           "attributes":[

           ],
           "custom":[

           ],
           "currency":"",
           "product_price":599.01,
           "categories":[

           ],
           "descriptions":[

           ],
           "match_score":1.0,
           "rank_score":0.0
        },
        {
           "alternative_id":null,
           "item_id":"itm_1313",
           "product_url":"?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-02f2e8ac6967417b8173a2384103496c&UTM_TPST=smart-search",
           "original_price":0.0,
           "date_added":"",
           "images":[

           ],
           "is_active":true,
           "main_image":"",
           "item_name":"Live food for live children and live parents",
           "alternative_name":"",
           "simple_name":"",
           "attributes":[

           ],
           "custom":[

           ],
           "currency":"",
           "product_price":660.0,
           "categories":[

           ],
           "descriptions":[

           ],
           "match_score":1.0,
           "rank_score":0.0
        },
        {
           "alternative_id":null,
           "product_url":"?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-02f2e8ac6967417b8173a2384103496c&UTM_TPST=smart-search",
           "original_price":0.0,
           "date_added":"",
           "images":[

           ],
           "is_active":true,
           "main_image":"",
           "item_name":"Poisonous dandelion milk",
           "alternative_name":"",
           "simple_name":"",
           "attributes":[

           ],
           "custom":[

           ],
           "currency":"",
           "product_price":825.0,
           "categories":[

           ],
           "descriptions":[

           ],
           "match_score":1.0,
           "rank_score":0.0
        },
        {
           "alternative_id":null,
           "item_id":"itm_160",
           "product_url":"?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-02f2e8ac6967417b8173a2384103496c&UTM_TPST=smart-search",
           "original_price":0.0,
           "date_added":"",
           "images":[

           ],
           "is_active":true,
           "main_image":"",
           "item_name":"Egg, milk, water...",
           "alternative_name":"",
           "simple_name":"",
           "attributes":[

           ],
           "custom":[

           ],
           "currency":"",
           "product_price":790.0,
           "categories":[

           ],
           "descriptions":[

           ],
           "match_score":1.0,
           "rank_score":0.0
        },
        {
           "alternative_id":null,
           "item_id":"i_13523",
           "product_url":"?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-02f2e8ac6967417b8173a2384103496c&UTM_TPST=smart-search",
           "original_price":0.0,
           "date_added":"",
           "images":[

           ],
           "is_active":true,
           "main_image":"",
           "item_name":"MLEKO ECO SPF30 200ML CAR",
           "alternative_name":"",
           "simple_name":"",
           "attributes":[

           ],
           "custom":[

           ],
           "currency":"",
           "product_price":0.0,
           "categories":[

           ],
           "descriptions":[

           ],
           "match_score":1.0,
           "rank_score":0.0
        }
     ]
  }

Create Smart Recommender touchpoint

First step is for sure to create a smart-recommender strategy.

curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies"
'{
   "strategy_name":"Smart Recommender default strategy",
   "strategy_type":"smart-recommender",
   "strategy_subtype":"carousel",
   "strategy_goal":"increase-cross-sell-and-up-sell",
   "author":"Violeta",
   "is_draft":false,
   "is_general_filter":true,
   "is_default":true,
   "audiences":[
      "all_customers"
   ],
   "product_hierarchy_level_id":"",
   "product_hierarchy_level_value":"",
   "rules":[
      {
         "rule_type":"most-recommended-products",
         "positions":[
            0,
            1,
            2,
            3,
            4
         ],
         "values":[

         ]
      }
   ]
}'

Then, create smart-recommender touchpoint with previous strategy:

  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/touchpoints"

  '{
     "touchpoint_name":"Smart Recommender ",
     "touchpoint_type":"smart-recommender",
     "touchpoint_subtype":"carousel",
     "author":"Violeta",
     "channel":"Website",
     "position":"position-id-a387c9bc0919475688ce334061f1c811",
     "default_strategy":"strategy-id-3b1573c8fb364d0e9583854758b659af",
     "number_of_positions":5,
     "is_draft":false
  }'
  {
     "touchpoint_name":"Smart Recommender ",
     "touchpoint_type":"smart-recommender",
     "touchpoint_subtype":"carousel",
     "author":"Violeta",
     "channel":"Website",
     "position":"position-id-a387c9bc0919475688ce334061f1c811",
     "is_active":false,
     "is_draft":false,
     "number_of_positions":5,
     "default_strategy":"strategy-id-3b1573c8fb364d0e9583854758b659af",
     "strategies":[

     ],
     "touchpoint_id":"touchpoint-id-378d66191628489c841edc3a37af8bab",
     "is_ready":false,
     "is_calculating":false,
     "is_using_fallback":false,
     "date_created":"2023-09-13T11:31:43",
     "date_modified":"2023-09-13T11:31:43"
  }

Preview route

You can test the touchpoint with the next route:

   curl -X GET "https://dev.thingsolver.com/api/latest/touchpoint-studio/touchpoints/touchpoint-id-378d66191628489c841edc3a37af8bab/preview"
Response is
   {
   "touchpoint_id":"touchpoint-id-378d66191628489c841edc3a37af8bab-default",
   "touchpoint_type":"smart-recommender",
   "identity_type":"",
   "identity_value":"",
   "content":[
      {
         "position":0,
         "item":{
            "item_id":"i_813",
            "item_name":"ITEM1",
            "alternative_id":"460103482",
            "alternative_name":"ITEM ITEM",
            "simple_name":"ITEM",
            "is_active":true,
            "product_url":"https://prod.example.com/products/visit/i_813.html?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-378d66191628489c841edc3a37af8bab&UTM_TPST=smart-recommender",
            "product_price":84.99,
            "original_price":84.99,
            "currency":"RSD",
            "main_image":"https://sais-sk-rs.s3.eu-central-1.amazonaws.com/public/item-images/460103482.png",
            "images":[

            ],
            "attributes":[
               {
                  "attribute_name":"attribute_author",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_gender",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_color",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_collection",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_brand",
                  "attribute_value":"HEINEKEN SERBIA DOO"
               },
               {
                  "attribute_name":"attribute_script",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_season",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_material",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_publisher",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_sport",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_genre",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_type",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_year_of_publication",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_format",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_supplier",
                  "attribute_value":"COCA-COLA HBC DOO"
               },
               {
                  "attribute_name":"attribute_cover",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_action",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_number_of_pages",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_price_range",
                  "attribute_value":"undefined"
               }
            ],
            "categories":[
               {
                  "category_level":"category_level_1",
                  "category_name":"CATEGORY - 456",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_3",
                  "category_name":"CATEGORY - 456",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_4",
                  "category_name":"CATEGORY - 456",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_2",
                  "category_name":"CATEGORY - 456",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_0",
                  "category_name":"CATEGORY - 456",
                  "category_type":"category"
               }
            ],
            "descriptions":[
               {
                  "description_language":"",
                  "description_value":null
               }
            ]
         }
      },
      {
         "position":1,
         "item":{
            "item_id":"i_181",
            "item_name":"SLICED MEAT 100G NEOPLANT",
            "alternative_id":"305000225",
            "alternative_name":"SLICED MEAT 100G NEOPLANT",
            "simple_name":"SLICED MEAT 100G NEOPLANT",
            "is_active":true,
            "product_url":"https://prod.example.com/products/visit/i_181.html?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-378d66191628489c841edc3a37af8bab&UTM_TPST=smart-recommender",
            "product_price":124.99,
            "original_price":124.99,
            "currency":"RSD",
            "main_image":"https://sais-sk-rs.s3.eu-central-1.amazonaws.com/public/item-images/305000225.png",
            "images":[

            ],
            "attributes":[
               {
                  "attribute_name":"attribute_author",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_gender",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_color",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_collection",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_brand",
                  "attribute_value":"NEOPLANTA"
               },
               {
                  "attribute_name":"attribute_script",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_season",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_material",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_publisher",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_sport",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_genre",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_type",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_year_of_publication",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_format",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_supplier",
                  "attribute_value":"NELT CO. Ltd"
               },
               {
                  "attribute_name":"attribute_cover",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_action",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_number_of_pages",
                  "attribute_value":"undefined"
               },
               {
                  "attribute_name":"attribute_price_range",
                  "attribute_value":"undefined"
               }
            ],
            "categories":[
               {
                  "category_level":"category_level_1",
                  "category_name":"CANNED MEAT - 498",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_3",
                  "category_name":"CANNED MEAT - 498",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_4",
                  "category_name":"CANNED MEAT - 498",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_2",
                  "category_name":"CANNED MEAT - 498",
                  "category_type":"category"
               },
               {
                  "category_level":"category_level_0",
                  "category_name":"CANNED MEAT - 498",
                  "category_type":"category"
               }
            ],
            "descriptions":[
               {
                  "description_language":"",
                  "description_value":null
               }
            ]
         }
      }
   ]
}

If touchpoint subtype is similar or related items query param product_hierarchy_level_value should be the item to retrieve similar/related products

Content route ( Integration route )

Content route /content is nearly similar to /preview route. Header params identity_value and identity_type:

  1. When identity_value equals to some product_id, identity_type should be set to product_id
  2. When identity_value = "default" (or any customer not found in database), identity_type will be set to customer_id by default
  3. When identity_value has cookie it is recognized it will return correct value for customer_id
    curl -X GET https://dev.thingsolver.com/api/latest/touchpoint-studio/touchpoints/touchpoint-id-378d66191628489c841edc3a37af8bab/content
              --header 'identity_value: customer_id'
              --header 'identity_type: 1-mam7f35g-lgov5ty2'
    

Response is:

      {
      "touchpoint_id":"touchpoint-id-78db539f3f384af799094418f250d92b",
      "touchpoint_type":"smart-recommender",
      "identity_type":"customer_id",
      "identity_value":"7363fb952d7ab6c7d1551e2c327ece2b",
      "content":[
         {
            "position":0,
            "item":{
               "item_id":"i_1228",
               "item_name":"TBL Effervescent MAGNESIUM 96G NATURAL",
               "alternative_id":"400105092",
               "alternative_name":"TBL Effervescent MAGNESIUM 96G NATURAL",
               "simple_name":"TBL Effervescent MAGNESIUM 96G NATURAL",
               "is_active":true,
               "product_url":"https://prod.example.com/products/visit/i_1228.html?UTM_SYSTEM=SAIS&UTM_SAIS=Touchpoint&UTM_TPID=touchpoint-id-78db539f3f384af799094418f250d92b&UTM_TPST=smart-recommender",
               "product_price":179.99,
               "original_price":259.99,
               "currency":"RSD",
               "main_image":"https://sais-sk-rs.s3.eu-central-1.amazonaws.com/public/item-images/400105092.png",
               "images":[

               ],
               "attributes":[
                  {
                     "attribute_name":"attribute_author",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_gender",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_color",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_collection",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_brand",
                     "attribute_value":"NATUREL"
                  },
                  {
                     "attribute_name":"attribute_script",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_season",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_material",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_publisher",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_sport",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_genre",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_type",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_year_of_publication",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_format",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_supplier",
                     "attribute_value":"AWT INTERNATIONAL"
                  },
                  {
                     "attribute_name":"attribute_cover",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_action",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_number_of_pages",
                     "attribute_value":"undefined"
                  },
                  {
                     "attribute_name":"attribute_price_range",
                     "attribute_value":"undefined"
                  }
               ],
               "categories":[
                  {
                     "category_level":"category_level_1",
                     "category_name":"VITAMINS AND MINERALS - 528",
                     "category_type":"category"
                  },
                  {
                     "category_level":"category_level_3",
                     "category_name":"VITAMINS AND MINERALS - 528",
                     "category_type":"category"
                  },
                  {
                     "category_level":"category_level_4",
                     "category_name":"VITAMINS AND MINERALS - 528",
                     "category_type":"category"
                  },
                  {
                     "category_level":"category_level_2",
                     "category_name":"VITAMINS AND MINERALS - 528",
                     "category_type":"category"
                  },
                  {
                     "category_level":"category_level_0",
                     "category_name":"VITAMINS AND MINERALS - 528",
                     "category_type":"category"
                  }
               ],
               "descriptions":[
                  {
                     "description_language":"",
                     "description_value":null
                  }
               ]
            }
         }
      ]
   }

Create Wheel of Fortune Touchpoint

Wheel of fortune prerequisit

To create wheel-of-fortune touchpoint Leaflet API is pre-required.

First create wheel-of-fortune strategy:

curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/strategies"

'{
   "strategy_name":"Wheel of Fortune default strategy",
   "strategy_type":"wheel-of-fortune",
   "strategy_subtype":"wheel-of-fortune",
   "strategy_goal":"boost-chosen-products-for-Running",
   "author":"Violeta",
   "is_draft":false,
   "is_active":false,
   "audiences":[
      "all_customers"
   ],
   "is_general_filter":false,
   "is_default":true,
   "product_hierarchy_level_id":"discount-leaflet",
   "product_hierarchy_level_value":"",
   "rules":[
      {
         "rule_type":"discount-leaflet",
         "positions":[
            0
         ],
         "values":[
            {
               "comparator":"=",
               "value":"discount-id-lonsdale",
               "column_name":"discount_id"
            }
         ]
      },
      {
         "rule_type":"discount-leaflet",
         "positions":[
            1
         ],
         "values":[
            {
               "comparator":"=",
               "value":"discount-id-nike-patike",
               "column_name":"discount_id"
            }
         ]
      },
      {
         "rule_type":"discount-leaflet",
         "positions":[
            2
         ],
         "values":[
            {
               "comparator":"=",
               "value":"discount-id-asics",
               "column_name":"discount_id"
            }
         ]
      },
      {
         "rule_type":"discount-leaflet",
         "positions":[
            3
         ],
         "values":[
            {
               "comparator":"=",
               "value":"discount-id-asics",
               "column_name":"discount_id"
            }
         ]
      }
   ],
   "strategy_id":"strategy-id-353ac92dd1a14c68b00a27a800baa87e",
   "is_ready":false,
   "audience_count":719303,
   "date_created":"2023-09-13T11:59:00",
   "date_modified":"2023-09-13T11:59:00"
}'

Then, create smart-recommender touchpoint with the previous strategy:

   curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/touchpoints"

   '{
      "touchpoint_name":"Wheel of Fortune",
      "touchpoint_type":"wheel-of-fortune",
      "touchpoint_subtype":"wheel-of-fortune",
      "author":"Violeta",
      "channel":"App",
      "position":"position-id-43b025df01564b4aa4c4a7b93db4a712",
      "default_strategy":"strategy-id-353ac92dd1a14c68b00a27a800baa87e",
      "number_of_positions":4,
      "is_draft":false
   }'

After creating touchpoint you need to configure the promotion in Promotion API:

  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/promotions/sms/config"

  '{
     "touchpoint_id":"touchpoint-id-d5635742c9d7473497538cdac8cec37a",
     "author":"Violeta",
     "promotion_base_url":"https://thingsolver.com",
     "config":[
        {
           "message_type":"promotion-message",
           "message_template":"Hey! Lets spin the wheel on the next - {link} "
        },
        {
           "message_type":"promotion-main-description",
           "message_template":"This is wheel title"
        },
        {
           "message_type":"successful-attempt",
           "message_template":"You won - {promotion_long_name} "
        },
        {
           "message_type":"invalid-attempt",
           "message_template":"You won - {promotion_long_name} "
        }
     ]
  }'
  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/promotions/sms/config"

  '{
     "touchpoint_id":"touchpoint-id-d5635742c9d7473497538cdac8cec37a",
     "author":"Violeta",
     "promotion_base_url":"https://thingsolver.com",
     "config":[
        {
           "message_type":"promotion-message",
           "message_template":"Hey! Lets spin the wheel on the next - {link} "
        },
        {
           "message_type":"promotion-main-description",
           "message_template":"This is wheel title"
        },
        {
           "message_type":"successful-attempt",
           "message_template":"You won - {promotion_long_name} "
        },
        {
           "message_type":"invalid-attempt",
           "message_template":"You won - {promotion_long_name} "
        }
     ],
     "promotion_id":"promotion-id-ec481dd2bca7e2caf38c10c827dec5bd",
     "date_created":"2023-09-13T11:59:01",
     "date_modified":"2023-09-13T11:59:01"
  }'

Below you can find a way to test your touchpoint with real promotion and communication message:

  curl -X POST "https://dev.thingsolver.com/api/latest/touchpoint-studio/promotions/sms/config"

  '{
     "customer_id":"",
     "touchpoint_id":"touchpoint-id-d5635742c9d7473497538cdac8cec37a",
     "concept_id":"Running",
     "phone_number":"381XXXXXXXXX"
  }'
  {
     "detail":"Test promotion with touchpoint_id touchpoint-id-d5635742c9d7473497538cdac8cec37a sent to test customer with number 381XXXXXXXXX successfully"
     }

Soon you will receive a SMS with a link to spin the wheel.

Update touchpoint

You can edit touchpoint with PUT request like this:

  curl -X PUT "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/touchpoints/touchpoint-id-d5635742c9d7473497538cdac8cec37a"
  '{
     "touchpoint_name":"Wheel of Fortune EDITED",
     "touchpoint_type":"wheel-of-fortune",
     "touchpoint_subtype":"wheel-of-fortune",
     "author":"Violeta",
     "channel":"App",
     "position":"position-id-43b025df01564b4aa4c4a7b93db4a712",
     "default_strategy":"strategy-id-353ac92dd1a14c68b00a27a800baa87e",
     "number_of_positions":4,
     "is_draft":false
  }'
  '{
     "touchpoint_name":"Wheel of Fortune EDITED",
     "touchpoint_type":"wheel-of-fortune",
     "touchpoint_subtype":"wheel-of-fortune",
     "author":"Violeta",
     "channel":"App",
     "position":"position-id-43b025df01564b4aa4c4a7b93db4a712",
     "is_active":false,
     "is_draft":false,
     "number_of_positions":4,
     "default_strategy":"strategy-id-353ac92dd1a14c68b00a27a800baa87e",
     "strategies":[

     ],
     "touchpoint_id":"touchpoint-id-d5635742c9d7473497538cdac8cec37a",
     "is_ready":false,
     "is_calculating":false,
     "is_using_fallback":false,
     "date_created":"2023-09-13T11:59:01",
     "date_modified":"2023-09-13T12:41:28"
  }'

Delete touchpoint

Position can be deleted with simple DELETE request:

  curl -X DELETE "https://dev.thingsolver.com/api/latest/touchpoint-studio/rules/touchpoints/touchpoint-id-378d66191628489c841edc3a37af8bab"
  {
     "detail":"Touchpoint deleted successfully"
  }
Back to top