APIs¶
We have an extensive APIs that enables you to build smart eCommerce applications, internal analytics and projects. The eComtics API is build using REST.
- Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients.
- Our APIs support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. You should never expose secret API key on a public website.
- All our APIs returns JSON as API responses, including errors.
- All our APIs are secure
Authentication¶
Every account is will include a secret API key. You can manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth.
All the APIs Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
Errors¶
HTTP response codes to indicate the success or failure of an API request.
- Codes in the 2xx range indicate success.
- Codes in the 4xx range indicate an error that failed given the information provided
- codes in the 5xx range indicate an server error.
- APIs which are valid but not complete will have error message indicating the error.
Event Logging API¶
Description¶
Event Logging JSON interface is designed to send user events/actions. The message interface is designed generically to support future requirements and extensibility. The interface will allow message recursion to support messages within a message.
If the type of the value is json for a certain key, say key1, it would result in recursion as given below.
“key_1”: { “value”: {“properties” : { “key_1”: { “value”: “xyz”, “type” : “DataType”}, ……. ……. “key_n”: { “value”: “xyz”, “type” : “DataType”} } }, “type”: “json” }
For Array type, following is the format:
“key_1”: { “value”: [], “type” :”array”, “element_type”: “Any Data types supported above other than Array type and json type”}, Example : “key_1”: { “value”: [1, 2, 3], “type” :”array”, “element_type”: “int”}
Location field is a string of latitude and longitude separated by comma. Example location for Mumbai:
“key_1”: { “value”: “21.18,77.33”, type”: “latlong”}
Properties fields is mandatory. Keys, values pairs inside the properties fields are optional. Date field should be in ISO date format.
“key_1”: { “value”: “2015-11-21T01:51:17Z”, type”: “ISO_date”}
API Definition¶
-
POST https://api.ecomtics.com/events/v1
Parameters¶
inputJson: Required. The input key/values you want to capture. string apikey: Required. Your secret API key. string orgid: Required. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) inputJson: { "properties": { "eventAction": { "type": "string", "value": "load" }, "eventType": { "type": "string", "value": "view" }, "ipAddress": { "type": "string", "value": "24.5.125.53" }, "is_mobile": { "type": "boolean", "value": false }, "deviceInfo": { "type": "string", "value": "MacIntel" }, "browserInfo": { "type": "string", "value": "Chrome 59" }, "spotDy_uid": { "type": "string", "value": "00696e4c-a4ed-4ff8-8a14-6bb9cc6a6c62" }, "domain": { "type": "string", "value": "boatsvilla.com" }, "date": { "type": "ISO_DATE", "value": "2017-07-28T02:54:45.663Z" }, "currentPageUrl": { "type": "string", "value": "http://boatsvilla.com/" }, "spotdy_eventid": { "value": "0d1f571d-3bc4-4022-a2c3-07cfc48b31d9", "type": "string" }, "spotdySessionId": { "type": "string", "value": "948756c3-1c58-45b8-bbe6-b4a8d9f5309a" }, "spotdy_eventname": { "value": "__ecomtics_pageview", "type": "string" }, "userid": { "value": "arvind.rapaka@spotdy.com", "type": "string" } } }
Response¶
{ responseCode: "SUCCESS" }
Viewed Also Viewed API¶
Description¶
Display Viewed Also Viewed on product page optimized based on product features and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product and customer features. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/vav/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number sku: Required. Product ID or SKU number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) sku: XXXXX (Product ID) limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "Users who viewed this also Viewed", "docs": [{ "name_s": "French Cuff Cotton Twill Oxford", "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": 190, "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html", "product_id_s": 402 }, { "name_s": "Bowery Chino Pants", "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/p/mpd003a_2.jpg", "price_d": 140, "sku_s": "mpd003c", "currentPageUrl_s": "http://etrial.xyz/bowery-chino-pants-541.html", "product_id_s": 414 }, { "name_s": "Plaid Cotton Shirt", "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj006a.jpg", "price_d": 160, "sku_s": "msj006c", "currentPageUrl_s": "http://etrial.xyz/plaid-cotton-shirt-574.html", "product_id_s": 404 }, { "name_s": "Linen Blazer", "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj012a_2.jpg", "price_d": 455, "sku_s": "msj012c", "currentPageUrl_s": "http://etrial.xyz/linen-blazer-580.html", "product_id_s": 406 }], "qtype": "viewedalsoviewed", "success": "0", "numberofdocs": 4 }
Bought Also Bought API¶
Description¶
Display mostly bought also bought on product page optimized based on product features and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product and customer features. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/bab/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number sku: Required. Product ID or SKU number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) sku: XXXXX (Product ID) limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "bought also bought", "docs": [{ "name_s": "French Cuff Cotton Twill Oxford", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": 190, "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html" }, { "name_s": "Core Striped Sport Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/t/mtk012a.jpg", "price_d": 125, "sku_s": "mtk012c", "currentPageUrl_s": "http://etrial.xyz/core-striped-sport-shirt-547.html" }, { "name_s": "Plaid Cotton Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj006a.jpg", "price_d": 160, "sku_s": "msj006c", "currentPageUrl_s": "http://etrial.xyz/plaid-cotton-shirt-574.html" }], "qtype": "contentbasedreco", "success": "0", "numberofdocs": 3 }
Product Recommendations API¶
Description¶
Display Product Recommendations on product page optimized based on product features and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product features and customer behavior. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/prr/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number sku: Required. Product ID or SKU number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) sku: XXXXX (Product ID) limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "Recommendations for You", "docs": [{ "name_s": "Plaid Cotton Shirt", "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj006a.jpg", "price_d": 160, "sku_s": "msj006c", "currentPageUrl_s": "http://etrial.xyz/plaid-cotton-shirt-574.html" }, { "name_s": "French Cuff Cotton Twill Oxford", "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": 190, "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html" }], "qtype": "categoryreco", "success": "0", "numberofdocs": 2 }
Product Consideration API¶
Description¶
Display Product Consideration on product page optimized based on product features and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product and customer features. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/prc/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number sku: Required. Product ID or SKU number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) sku: Product ID or SKU limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "More Items to Consider", "docs": [{ "name_s": "French Cuff Cotton Twill Oxford", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": 190, "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html" }, { "name_s": "Core Striped Sport Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/t/mtk012a.jpg", "price_d": 125, "sku_s": "mtk012c", "currentPageUrl_s": "http://etrial.xyz/core-striped-sport-shirt-547.html" }, { "name_s": "Plaid Cotton Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj006a.jpg", "price_d": 160, "sku_s": "msj006c", "currentPageUrl_s": "http://etrial.xyz/plaid-cotton-shirt-574.html" }], "qtype": "contentbasedreco", "success": "0", "numberofdocs": 3 }
Product Trending API¶
Description¶
Display Product Trending optimized based on trending products and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product and customer features. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/prt/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number sku: Required. Product ID or SKU number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) sku: Product ID or SKU limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "Hot Trending Items", "docs": [{ "name_s": "Tori Tank", "smallImage_s": "http://etrial.xyz/media/catalog/product/w/b/wbk003a.jpg", "price_d": "60.0", "sku_s": "wbk003c", "currentPageUrl_s": "http://etrial.xyz/tori-tank-587.html" }, { "name_s": "French Cuff Cotton Twill Oxford", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": "190.0", "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html" }, { "name_s": "Chelsea Tee", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/t/mtk002a.jpg", "price_d": "75.0", "sku_s": "mtk002c", "currentPageUrl_s": "http://etrial.xyz/chelsea-tee-702.html" }, { "name_s": "TriBeCa Skinny Jean", "smallImage_s": "http://etrial.xyz/media/catalog/product/w/p/wpd000a_2.jpg", "price_d": "185.0", "sku_s": "wpd000c", "currentPageUrl_s": "http://etrial.xyz/tribeca-skinny-jean.html" }, { "name_s": "Bowery Chino Pants", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/p/mpd003a_2.jpg", "price_d": "140.0", "sku_s": "mpd003c", "currentPageUrl_s": "http://etrial.xyz/bowery-chino-pants-541.html" }, { "name_s": "Aviator Sunglasses", "smallImage_s": "http://etrial.xyz/media/catalog/product/a/c/ace000a_1.jpg", "price_d": "295.0", "sku_s": "ace000", "currentPageUrl_s": "http://etrial.xyz/aviator-sunglasses.html" }, { "name_s": "Lexington Cardigan Sweater", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/t/mtk009a.jpg", "price_d": "240.0", "sku_s": "mtk009c", "currentPageUrl_s": "http://etrial.xyz/lexington-cardigan-sweater-561.html" }, { "name_s": "Modern Murray Ceramic Vase", "smallImage_s": "http://etrial.xyz/media/catalog/product/h/d/hdd001_2.jpg", "price_d": "135.0", "sku_s": "hdd001c", "currentPageUrl_s": "http://etrial.xyz/modern-murray-ceramic-vase-480.html" }, { "name_s": "Swing Time Earrings", "smallImage_s": "http://etrial.xyz/media/catalog/product/a/c/acj004_2.jpg", "price_d": "75.0", "sku_s": "acj004", "currentPageUrl_s": "http://etrial.xyz/swing-time-earrings.html" }, { "name_s": "Ludlow Sheath Dress", "smallImage_s": "http://etrial.xyz/media/catalog/product/w/s/wsd008t_2.jpg", "price_d": "305.0", "sku_s": "wsd008c", "currentPageUrl_s": "http://etrial.xyz/ludlow-sheath-dress.html" }], "qtype": "trending", "success": "0", "numberofdocs": 10 }
Browsing History API¶
Description¶
Display Browsing History on product page optimized based on product features and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product and customer features. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/ibb/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "Inspired By Your Browsing History", "docs": [{ "name_s": "French Cuff Cotton Twill Oxford", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": 190, "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html" }, { "name_s": "Core Striped Sport Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/t/mtk012a.jpg", "price_d": 125, "sku_s": "mtk012c", "currentPageUrl_s": "http://etrial.xyz/core-striped-sport-shirt-547.html" }, { "name_s": "Plaid Cotton Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj006a.jpg", "price_d": 160, "sku_s": "msj006c", "currentPageUrl_s": "http://etrial.xyz/plaid-cotton-shirt-574.html" }], "qtype": "contentbasedreco", "success": "0", "numberofdocs": 3 }
Frequently Bought Together API¶
Description¶
Display Frequently Bought Together on product page optimized based on product features and customer behaviour in realtime. Our Machine Learning Algorithms dynamically optimizes based on the product and customer features. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/fbt/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number sku: Required. Product ID or SKU number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) sku: Product ID or SKU limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "Frequently bought together", "docs": [{ "cannoical_url_s": "http://etrial.xyz/catalog/product/view/id/234", "name_s": "Slim fit Dobby Oxford Shirt", "productinview": true, "imageurltype": "absolute", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj003t_1.jpg", "image_s": "http://etrial.xyz/media/catalog/product/m/s/msj003t_1.jpg", "product_id_s": "234" }, { "name_s": "Delancy Cardigan Sweater", "smallImage_s": "http://etrial.xyz/media/catalog/product/w/b/wbk006a.jpg", "price_d": 275, "sku_s": "wbk006c", "currentPageUrl_s": "http://etrial.xyz/delancy-cardigan-sweater-589.html", "product_id_s": 419 }], "qtype": "crosssell", "success": "0", "numberofdocs": 2 }
Recent Views API¶
Description¶
Display Recent Views. To be effective you need to enable eComtics cookies.
API Definition¶
-
GET https://api.ecomtics.com/rv/v1
Parameters¶
string apikey: Required. Your secret API key. string orgid: Required. Your org id number limit: Optional. Your org id
Request¶
apikey: XXXXX (YOUR API SECRET KEY) orgid: XXXXX (YOUR ORG ID) limit: 1-10 (Number of Products to retrive)
Response¶
{ "widgetname": "Recent Views", "docs": [{ "name_s": "French Cuff Cotton Twill Oxford", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj000a_2.jpg", "price_d": 190, "sku_s": "msj000c", "currentPageUrl_s": "http://etrial.xyz/french-cuff-cotton-twill-oxford-570.html" }, { "name_s": "Core Striped Sport Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/t/mtk012a.jpg", "price_d": 125, "sku_s": "mtk012c", "currentPageUrl_s": "http://etrial.xyz/core-striped-sport-shirt-547.html" }, { "name_s": "Plaid Cotton Shirt", "smallImage_s": "http://etrial.xyz/media/catalog/product/m/s/msj006a.jpg", "price_d": 160, "sku_s": "msj006c", "currentPageUrl_s": "http://etrial.xyz/plaid-cotton-shirt-574.html" }], "qtype": "contentbasedreco", "success": "0", "numberofdocs": 3 }