Email Recommendations Widget APIs

👍

Prerequisite

For detailed information on the Email Recommendations feature and its use-cases, go through its feature guide.

What are the Email Recommendations APIs?

The Email Recommendations APIs are same as the Recommendations and Pathways API v2, for all the 5 widget types, except that each API can now be either a Proxy API or an Image API.
The response formats of the Email Recommendations APIs are different from the Recommendations APIs. Unlike the latter, where we get a JSON response containing details of multiple products in that widget, the Email Recommendations APIs' response is a redirect (HTTP 302) to either a Product Description Page or an Image of a single product.

📘

Proxy and Image APIs

The Proxy APIs redirect to the Product Description Page of the product and Image APIs redirect to the Image of the product.

The email should have a template defined, which can then be integrated with different Email Service Providers.

Here is a sample email template:

<html>
<body>

<h2> Sale going on!!! </h2>

<a href="http://pathways-email.dxpapi.com/api/v2/widgets/proxy/category/kjy4y2jv?_br_uid_2=uid%3D1251839531436%3Av%3D15.0%3Ats%3D1606749087372%3Ahc%3D13&account_id=6370&domain_key=pacific_supply&user_id=6453546d-5b17-41f4-8fad-43f379d3657f&url=https%3A%2F%2Fwww.pacific.com%2Fso3005719.html&ref_url=https%3A%2F%2Fwww.pacific.com%2Fl%2F%3Fsearchinfo%3Dps5%2520console%26mode%3Dedu%26sel%3DItem-Condition_New-Items&fields=pid&cat_id=na_280200000000&query=box&start=0&rows=5"/>
<img src="http://pathways-email.dxpapi.com/api/v2/widgets/image/category/kjy4y2jv?_br_uid_2=uid%3D1251839531436%3Av%3D15.0%3Ats%3D1606749087372%3Ahc%3D13&account_id=6370&domain_key=pacific_supply&user_id=6453546d-5b17-41f4-8fad-43f379d3657f&url=https%3A%2F%2Fwww.pacific.com%2Fso3005719.html&ref_url=https%3A%2F%2Fwww.pacific.com%2Fl%2F%3Fsearchinfo%3Dps5%2520console%26mode%3Dedu%26sel%3DItem-Condition_New-Items&fields=pid&cat_id=na_280200000000&query=box&start=0&rows=5" width="200" height="300"/>

<a href="http://pathways-email.dxpapi.com/api/v2/widgets/proxy/category/kjy4y2jv?_br_uid_2=uid%3D1251839531436%3Av%3D15.0%3Ats%3D1606749087372%3Ahc%3D13&account_id=6370&domain_key=pacific_supply&user_id=6453546d-5b17-41f4-8fad-43f379d3657f&url=https%3A%2F%2Fwww.pacific.com%2Fso3005719.html&ref_url=https%3A%2F%2Fwww.pacific.com%2Fl%2F%3Fsearchinfo%3Dps5%2520console%26mode%3Dedu%26sel%3DItem-Condition_New-Items&fields=pid&cat_id=na_280200000000&query=box&start=1&rows=5"/>
<img src="http://pathways-email.dxpapi.com/api/v2/widgets/image/category/kjy4y2jv?_br_uid_2=uid%3D1251839531436%3Av%3D15.0%3Ats%3D1606749087372%3Ahc%3D13&account_id=6370&domain_key=pacific_supply&user_id=6453546d-5b17-41f4-8fad-43f379d3657f&url=https%3A%2F%2Fwww.pacific.com%2Fso3005719.html&ref_url=https%3A%2F%2Fwww.pacific.com%2Fl%2F%3Fsearchinfo%3Dps5%2520console%26mode%3Dedu%26sel%3DItem-Condition_New-Items&fields=pid&cat_id=na_280200000000&query=box&start=1&rows=5"width="200" height="300"/>


<a href="http://pathways-email.dxpapi.com/api/v2/widgets/proxy/category/kjy4y2jv?_br_uid_2=uid%3D1251839531436%3Av%3D15.0%3Ats%3D1606749087372%3Ahc%3D13&account_id=6370&domain_key=pacific_supply&user_id=6453546d-5b17-41f4-8fad-43f379d3657f&url=https%3A%2F%2Fwww.pacific.com%2Fso3005719.html&ref_url=https%3A%2F%2Fwww.pacific.com%2Fl%2F%3Fsearchinfo%3Dps5%2520console%26mode%3Dedu%26sel%3DItem-Condition_New-Items&fields=pid&cat_id=na_280200000000&query=box&start=2&rows=5"/>
<img src="http://pathways-email.dxpapi.com/api/v2/widgets/image/category/kjy4y2jv?_br_uid_2=uid%3D1251839531436%3Av%3D15.0%3Ats%3D1606749087372%3Ahc%3D13&account_id=6370&domain_key=pacific_supply&user_id=6453546d-5b17-41f4-8fad-43f379d3657f&url=https%3A%2F%2Fwww.pacific.com%2Fso3005719.html&ref_url=https%3A%2F%2Fwww.pacific.com%2Fl%2F%3Fsearchinfo%3Dps5%2520console%26mode%3Dedu%26sel%3DItem-Condition_New-Items&fields=pid&cat_id=na_280200000000&query=box&start=2&rows=5"width="200" height="300"/>

</body>
</html>

In this template, we first decide the number of desired image slots, let's say, 3. For each slot, we have to define a hyperlink HTML tag (<a>) and an image HTML tag (<img>). The hyperlink tag will point to the Proxy API call and Image tag will point to the Image API call defined above.

For each image slot, the API calls are the same, except that we update the start parameter. start=0 denotes the first product of the recall set, start=1 denotes the second product of the recall set, and so on.

Endpoints

Production:
Proxy API: https://pathways-email.dxpapi.com/api/v2/widgets/proxy/{widget type}/{widget_id}
Image API: https://pathways-email.dxpapi.com/api/v2/widgets/image/{widget type}/{widget_id}

Staging:
Proxy API: https://pathways-email-staging.dxpapi.com/api/v2/widgets/proxy/{widget type}/{widget_id}
Image API: https://pathways-email-staging.dxpapi.com/api/v2/widgets/image/{widget type}/{widget_id}