===== Top-APIs =====
This service is used by customers such as Madeleine. Other customers have also announced to be interested in this functionality.
Ii is therefore **critical** that the service is running and functional.
===== High level Description =====
The service is comprised of four endpoints:
* /in\\
V3 billing data is sent to this endpoint
* /top_viewed/\\
returns the top viewed articles for a category
* /also_viewed/\\
returns for a product what other products were also viewed in a session
* /get_cat_trends/\\
returns products for a category sorted by interest scores
==== Top Sellers ====
Calculates which products were sold most often over the past 28 days. The data how often a product is sold is derived from the information submitted through the checkout.php API.
=== integration into a newsletter ===
in order to integrate the top sellers in a newsletter we need to return the data as images. For this reason the following API exists:
https://api.picalike.com/api/top_seller_mail.jpg can also be called as https://api.picalike.com/api/top_seller_mail.php for the itemLink (see below)
the following parameters can be set for the top_seller_mail.jpg:
* [required] key: token to select the correct feed
* [required] requestType: selecting the part of the data that should be rendered as an image. possible values:
* itemImage
* itemPrice
* itemStrikePrice
* itemName
* itemBrand
* itemLink
* [required] vid: session id (just for documentation purposes right now)
* [required] recoIndex: starting from 0, selecting a product from the list of top sellers
* [optional] priceFormat: integer (default: 1) the item price will be divided by this number. This is useful, if we have the price in cents, but the API should render the price in Euro. In this case you would need to submit a value of 100 here.
* [optional] limit: integer (default: 10)
* [optional] fontType: select the font: (default: arial)
* arial: Arial
* arialbd: Arial Bold
* comic-sans: Comic
* courier: Courier
* helvetica: Helvetica
* tahoma: Tahoma
* tahomabd: Tahoma Bold
* times-new-roman: Times New Roman
* times-new-roman-bold: Times New Roman Bold
* verdana: Verdana
* verdanab: Verdana Bold
* miller-banner: Miller Banner
* mulish: Mulish
* [optional] cat: filter by category (has to be exact match from the product feed)
* [optional] gender: filter by gender (has to be exact match from the product feed)
example:
https://api.picalike.com/api/top_seller_mail.jpg?key=cGljc2ltaWxhcjozMzI2&limit=10&requestType=itemImage&vid=-1&recoIndex=1
* key: selects “WCC Witt DE (amde)” (do not share with unauthorized people!)
* limit: up to 10 products are precalculated
* requestType: the product image is selected
* vid: a session id
* recoIndex: the second product is selected
=== the data directly ===
https://api.picalike.com/top_sellers.php?key=cGljc2ltaWxhcjoyMDUz&limit=10
===== Links =====
* Gits:
* Top Looks: https://git.picalike.corpex-kunden.de/picalike/top_looks_api
* Top Looks: https://git.picalike.corpex-kunden.de/picalike/top_looks_fill_db
* Top Viewed + Top Sellers: https://git.picalike.corpex-kunden.de/picalike/top_viewed_api
* Also Viewed Api: https://git.picalike.corpex-kunden.de/picalike/also_viewed_api
* get_cat_trends: https://git.picalike.corpex-kunden.de/picalike/get-category-trends
===== Operations =====
die folgenden Container sollten auf frontend05-hpc laufen:
* top_looks_api_container
* top_looks_fill_db_container
* get_cat_trends_container
* also_viewed_api_container
* top_viewed_api_container
* top_viewed_mongo
* top_looks_mongo
=== Deploy this service ===
=== Start this service ===
{{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}} Für Corpex: Die bash Skripte räumen den Dienst einmal weg und ziehen ihn neu auf.
{{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}} Für Alle: Da die Skripte ein source ./config.sh am Anfang haben, muss man sich im jeweiligen unterverzeichnis befinden, um diese auszuführen
Auf frontend05-hpc sind unter /home/picalike/docker_bin folgende verzeichnisse und relevante skripte. :
* {{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}}**also_viewed**/start_also_viewed_api.sh
* killt den aktuellen also_viewed_api_container
* entfernt den also_viewed_api_container
* startet den also_viewed_api_container neu
* {{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}}**get_cat_trends**/start_get_cat_trends.sh
* killt den aktuellen get_cat_trends_container
* entfernt den get_cat_trends_container
* startet den get_cat_trends_container neu
* {{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}}**top_looks_fill_db**/start_top_looks_fill_db.sh
* killt den aktuellen top_looks_fill_db_container
* entfernt den top_looks_fill_db_container
* legt das docker network 'top_looks_network' an
* es wird versucht top_looks_mongo anzulegen und zu starten, wenn der container schon existiert, wird der existierende container gestartet
* python collection_index_generator.py
* startet den top_looks_fill_db_container
* python3 update_collections.py &> /mnt/storage/var/log/top_looks_update.log &
* {{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}}**top_looks_api**/start_top_looks_api.sh
* killt den aktuellen top_looks_container
* entfernt den top_looks_container
* startet den top_looks_container neu
* {{/dokuwiki/lib/images/smileys/icon_exclaim.gif|:!:}}**top_viewed_api**/start_top_viewed_api.sh
* killt den aktuellen top_viewed_container
* entfernt den top_viewed_container
* startet den top_viewed_container neu
=== Use this service ===
* give! some! examples!
* how to test
* how to perform an external, non-inversive test
* how to monitor
*
=== Repair this service ===
* Possible Issues
* Possible Solutions
*
===== Super Special Knowledge =====
===== Experiments / Results / Knowledge Base =====
You performed a test? share it.
===== Dependencies =====
===== Incident Log =====
Incidents should be collected in a global list for now: [[incidents|incidents]] (uses “**component**: top-apis” to identify this component)
===== Authors =====