HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Recs only endpoint

The requester needs to supply the following information as JSON.

Parameters Description
lang [Optional] Language code of the store. For example:

"lang" : "en-gb"
If not specified, en-gb is the default.
user [Optional] For example:

"user" : {…}

Note: When you provide user, also supply id; email is deprecated.

  email [Deprecated] [Optional] The email address of the customer. For example:

"email" : "[email protected]"

Note: Use id instead because email is deprecated and kept for backward compatibility only.

  id [Optional] Pseudonymised ID of the user. For example:

"id" : "abcd1234efgh"
This identifies the user in the Personalization system. Use the user ID to improve tracking and recommendations; you can use it also in other Optimizely products, such as Email Product Recommendations, and Triggered Messages.

Note: For Product Recommendations, to prevent user behavior from being lost, send Optimizely an up-to-date mapping between email addresses and pseudonymized user IDs. This needs to be provided only once so that Optimizely Personalization can replace existing customer email addresses with their corresponding pseudonymized user ID.

  info [Optional] Information about the customer, such as their diet, allergies, gender, loyalty card information. This is given in key-value pairs; the keys need to be defined with Optimizely before use. For example:

"info" : {
           "gender"  : "female", 
           "allergy" : "nuts",
           "diet"    : "vegan"
           "store"   : "StreamlyCool Bluewater"
           "colour"  : "yellow"
           "size"    : "10"
         }

New records are created; existing records are updated.

campaignId The ID of the widget campaign.

"campaignId" : "k3Rw892i"
smartRecs [Optional] Controls which attributes to show in the smartRecs callback.

"smartRecs"  : {…}
  showAttributes [Optional] A comma-separated list of attribute names to send in the smartRecs callback.

If this property is not supplied, no attributes are sent. If this property is set to "*", all attributes are sent.

"showAttributes" : ["*"]
items [Optional] A list of products to influence the product recommendations.

"items" : ["ref01", "ref02", "ref03"]
excludeItems [Optional] A list of products to exclude from the product recommendations.

"excludeItems" : ["ref97", "ref98", "ref99"]
recContent [Optional] Recommendation content configuration for Product Recommendations. Available values are:

  • full. Full product details in the returned recommendation (such as, prices, image, title, URL). This is the default behavior if the recContent property is omitted.
  • refCodeOnly. Only returns a list of elements with the reference code and the ID.

Example

{
      "lang"          : "en-gb",
      "campaignId"    : "k3Rw892i",
      "items"         : ["ref01", "ref02", "ref03"],
      "excludeItems"  : ["ref97", "ref99", "ref99"],
      "abTestContent" : "full",
      "smartRecs"     : {              "showAttributes": ["*"]
                        },
      "user"          : {
                          "id"   : "abcd1234efgh",
                          "info" : {
                                     "gender"  : "male", 
                                     "allergy" : "dairy",
                                     "diet"    : "vegetarian"
                                   }            }
    }

If no user information is sent in the request, the response contains non-personalized product recommendations, such as best sellers. If user information is supplied, the product recommendations are personalized.

  • The URL for testing in the UAT environment is:
    • https://uat.peerius.com/tracker/smart-api/recommendations
  • The URL with the production end point follows one of the following formats, depending on your provisioned environment:
    • https://<sitename>.peerius.com/tracker/smart-api/recommendations
    • https://<sitename>.peerius.episerver.net/tracker/smart-api/recommendations

Contact Optimizely if you are unsure which domain applies to your integration.

📘

Notes

  • The sitename part of this address is assigned by Optimizely.
  • This entry point requires a request header containing the authentication parameters defined in the Header information section.
  • The request body needs to be sent in a POST request.
  • Ensure that HTTPS is in the URL.