====== Widgets ======
Our customers Madeleine and Atelier Goldner Schnitt use widgets for their service. The Code lives on
picalike@frontend01-hpc.picalike.corpex-kunden.de:/mnt/storage/var/live/recobox/recobox
for AGS its the file outfit_widget.php , for madeleine sim_widget.php
----
**HINT: the following is possibly outdated**
===== Server =====
picalike@frontend05-hpc.picalike.corpex-kunden.de
===== APIs =====
==== Top Viewed API ====
API used to display the top called products from our APIs
=== Nagios Integration ===
* “incoming service” has nagios endpoint under http://frontend05-hpc.picalike.corpex-kunden.de:5001/service/health
* “outgoing serivce” has nagios endpoint under http://frontend05-hpc.picalike.corpex-kunden.de:5002/health
=== Repo ===
https://git.picalike.corpex-kunden.de/picalike/top_viewed_api
=== API Routes ===
== OUT ==
https://api.picalike.com/top_viewed_api/
== Call Examples ==
top_viewed_api/?key=cGljc2ltaWxhcjo3MjMz&days=2
== Params ==
* //key//: **required**, our customer id
* //days//: **required**, set the date range to look for results
* //category//: the category to filter the results
* //i//: the product to get information to filter the results
* //r//: <1> optional, when //'i'// is given, choose to display or not the product in the results
* //price_from//: optional, get price range to filter the results
* //price_till//: optional, get price range to filter the results
* //b//: optional, get brand to filter the results
* //gender//: optional, get gender to filter the results
* //limit//: optional, limit the number of results, defaults to 100
* //format//: optional, return as JSON instead of HTML (Frontend / Demo)
=== IN ===
{{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}} not yet well described
We send the messages (ZMQ) from billing direct to /in route as POST (JSON) and save in API's MongoDB
==== Get Category Trends ====
=== http:%%//%%frontend05-hpc.picalike.corpex-kunden.de:5003/get_cat_trends (GET) Port 5003 ===
Returns the most trendy products from a category of one shop. Only returns available products. Products sorted in descending order by cluster_trend.
**in:**
shop_id_key:
i: # if "i" is set, category is same as given prod_id. Default: None
optional:
limit: # default: 10
brand: # default: all
gender: # default: all
size: # default: all
price_till: # default: no max
price_from: # default: no min
r:0 or 1 # default: 1 # if r=1 and i is given returns ref_prod in results
**out:**
{"count": 10,
"description": "Category Trends",
"generator": "http://picalike.com",
"modified": "2019-04-29 08:24:04.480205",
"title": "picalike Request",
"ids": {"0": {"brand": "NO", "cluster_trend": 0.0, "extraimg": "https://www.witt.eu/product/resized/029/029.00K3F.072-127.002.u_5.jpg", "gender": "Damenmode", "shop_cat":"Frauen_Bekleidung_Hosen_Sweatpants", "id": "184097", "img": "https://www.witt.eu/product/resized/027/027.00KAT.022-123.013.i_5.jpg", "location": "https://www.witt-weiden.de/287202?articleNumber=184097", "name": "Hose", "price": 150.99, "min_price":135.99, "max_price":465.99,"strike_price":465.99,"x_size":[{"display_size":17,...},{...}]},
"1":{...}}
}
==== Also Viewed API ====
API used to display “wer das gesehen hat, hat das auch gesehen”
=== Repo ===
https://git.picalike.corpex-kunden.de/picalike/also_viewed_api
=== API Routes ===
== OUT ==
https://api.picalike.com/also_viewed_api/
== Call Examples ==
top_viewed_api/?key=cGljc2ltaWxhcjo0MTQ5&i=0171333&format=json&limit=12&r=1&test=1
== Params ==
* //key//: **required**, our customer id
* //i//: **required**, the product used as base to find the others
* //category//: the category to filter the results
* //r//: <1> optional, when //'i'// is given, choose to display or not the product in the results
* //price_from//: optional, get price range to filter the results
* //price_till//: optional, get price range to filter the results
* //b//: optional, get brand to filter the results
* //gender//: optional, get gender to filter the results
* //limit//: optional, limit the number of results, defaults to 100
* //format//: optional, return as JSON instead of HTML (Frontend / Demo)
* //remove_ref_cat//: optional, omit categories equal to the reference product category
=== IN ===
{{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}} not yet well described
==== Get_trends (POST/json) ====
API - URL: dev01.picalike.corpex-kunden.de:1113/get_trends
returns the most trendy attributes/pattern/colors/brands from the given picalike_cat
**in:**
picalike_cat: # Also possible sorting all cats that start with "fashion" --> "fashion_*"
type: ("pattern", "color", "attribute" or "brand")
optional:
limit: # default: 10
shop_id: [] # default: all shops (for sorting only crawler shops, type: "*_crawler")
sort: # "desc" or "asc" for sorting
sort_by_trend: # default: False (indicates what to sort for (position--> False or cluster_trend--> True)
**out:** {“msg”: “Found 5 documents”, “results”: [{“attribute”: [“pattern”], “cluster_trend”: -404.0, “position”: 1.0, “position_hist”: [“1.0”], “rank”: 0}, {“attribute”: [“business-style”], “cluster_trend”: -404.0, “position”: 1.0, “position_hist”: [“1.0”], “rank”: 1}, {“attribute”: [“summer”], “cluster_trend”: -404.0, “position”: 1.0, “position_hist”: [“1.0”], “rank”: 2}, {“attribute”: [“cropped”], “cluster_trend”: -404.0, “position”: 1.0, “position_hist”: [“1.0”], “rank”: 3}, {“attribute”: [“background”], “cluster_trend”: -404.0, “position”: 0.97934055, “position_hist”: [“0.9793404847040127”, “0.6460402342755284”], “rank”: 4}], “status”: 200}