How to deploy recommendation with SFMC
3
Add the Code Snippet in SFMC
%%[
set @url = "https://uc-info.eu.abtasty.com/v1/reco/1010/template/3d815596-8f6e-4ed4-a373-89792a9a2e06/recos/366c16d0-4934-4f31-930e-a57a1e3f757c"
Platform.Load("Core","1.1.1");
var url = Variable.GetValue("@url");
var headerNames = ["Authorization"];
var headerValues = ["Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaXRlX2lkIjoxMDEwLCJpYXQiOjE3NDI0NzYzNzIsImp0aSI6IlhDczN3WVdXM0dIVHlRNmx0VXY1TTkzR2hXdDlDZGkyR3lhQnJwUEdacE0ifQ.n3OUVQJyyHUXR2zene-OA7VVb4hUJOnVlGQqfmc6tuw"];
var response = HTTP.Get(url, headerNames, headerValues);
Variable.SetValue("@response", response.Content);
%%=TreatAsContent(@response)=%%
]%%

Snippet structure
%%[
var @CodeEAN, @url
set @CodeEAN = [CodeEAN]
set @url = Concat(
"https://uc-info.eu.abtasty.com/v1/reco/889/template/<TEMPLATE_ID>/recos/<RECO_ID>",
"?variables=%7B%22bought_item%22:%22", @CodeEAN, "%22%7D"
)
]%%
<script runat="server">
Platform.Load("Core","1.1.1");
var url = Variable.GetValue("@url");
var headerNames = ["Authorization"];
var headerValues = ["Bearer <YOUR_BEARER_TOKEN>"];
var response = HTTP.Get(url, headerNames, headerValues);
Variable.SetValue("@response", response.Content);
</script>
%%=TreatAsContent(@response)=%%Step 1: Build the URL with AMPScript
Step 2: Call the API with SSJS
Step 3: 1Inject the API Response into the Email
Last updated
Was this helpful?




