Table of Contents

Picalike Customer Interface

Host: pci01.picalike.corpex-kunden.de

Port: 8090

Dependencies

passlib==1.6.5

git

Im git zu finden als:

$ git clone git@git.picalike.corpex-kunden.de:picalike/pci.git

Operations

check upci

Allgemeines

Anfragen mit json als post

Antworten:

Test User:

"email" : "unittest@picalike.com",
"password_for_testing" : "picalike",
"userid" : "f6622021aae19fd282df4945a3a47aa8",
"username" : "unittest",
"uid" : [905]

Image Cache Server

Host: sg02.picalike.copex-kunden.de

Port: 8095

Aufrufbeispiel:

http://sg02.picalike.corpex-kunden.de:8095/<url_enc>
http://sg02.picalike.corpex-kunden.de:8095/http%3A%2F%2Fwww.picalike.com%2Fdesign%2Fpicalike%2Flogo.png

Der Server gibt die Datei zurück. Wenn nötig wird sie heruntergeladen, wenn möglich wird die gespeicherte Version aus dem Cache ausgespielt.

Zusätzlich gibt es die Möglichkeit die Bilder direkt resized zu bestellen, es wird grundsätzlich die Aspectratio beibehalten (wenn width zu height nicht passt gewinnt der größere Wert, der andere wird ignoriert):

http://sg02.picalike.corpex-kunden.de:8095/<url_enc>/width/height

Es braucht nur width oder height angegeben werden, der andere kann auf -1 gesetzt werden.

Apis

http://<host>:<port>/<api>

Testing with curl:

curl --data-binary @style_count.json -H "Content-type: application/json" "http://pci01.picalike.corpex-kunden.de:8090/style_count"

where style_count.json is a file containing the message that you want to send

/login

in:

{"email": <str>, "pwd": <str>}

out:

{
  "result": 2, 
  "message": <str>, 
  "response": {
    "userid": <str>, 
    "username": <str>,
    "sid": <str>,  # new session id
    "lang": <str>,  # default: 'en', if not set
    "fav_shop": <str, shop_id>  # only if it is set
    "shop_info": [{"shop_name": <str>, "apikey": <str>}], 
    "privileges": [<str>, ...], 
    "role": <str, default=user>, 
    "create_date": <datum>
  }
}

/delete_user

in:

{"userid": <str>}

out:

{"result": 1, "message": <str>, "response": {}}

/get_available_permissions

in:

{}

out:

{"result": <int>, "message": <str>, "response": {"permissions": [<str>, ...]}}

/user_by_shop

in:

{"shop_apikey": <str>, "include_all": <bool>}

include_all is optional and by default False, if True all users that include “all” in “uid” will be returned

out:

{"result": <int>, "message": <str>, "response": {"user_list": [{"username": <str>, "userid": <str>, "role": <str, default=user>}, ...]}}

/change_role

in:

{"userid": <str>, "role": <str>}

out:

{"result": <int>, "message": <str>, "response": {}}

/change_pwd

in:

{"userid": <str>, "pwd": <str>}

out:

{"result": <int>, "message": <str>, "response": {}}

/change_permissions

in:

{"userid": <str>, "permissions": [<str>, ...]}

out:

{"result": <int>, "message": <str>, "response": {}}

/user_data_by_sessionid

in:

{"sid": <str>}  # sessionid

out:

{"result": 1, "message": "OK", "response": {
  "userid": <str>, 
  "username": <str>,
  "email". <str>,
  "shop_info": [{"shop_name": <str>, "apikey": <str>}],
  "fav_shop": <str>  # only if it is set
  "privileges": [<str>, ...], 
  "role": <str, default=user>,
  "lang": <str>, 
  "create_date": <datum>
}}

/get_user

in:

{"userid": <str>}

out:

{"result": 1, "message": "OK", "response": {
  "userid": <str>, 
  "username": <str>, 
  "shop_info": [{"shop_name": <str>, "apikey": <str>}],
  "fav_shop": <str>  # only if it is set
  "privileges": [<str>, ...], 
  "role": <str, default=user>,
  "lang": <str>, 
  "create_date": <datum>
}}

/set_language

in:

{"userid": <str>, "lang": <str>}

out:

{"result": 1, "message": "OK", "response": {}}

lang is a two letter string, e.g.: 'de', 'en', …

/set_favorite_shop

in:

{"userid": <str>, "shop_id": <str>}

out:

{"result": 1, "message": "OK", "response": {}}

/check_session

in:

{
  "userid": <str>, 
  "sid": <str>,
  "action": <str, default: "unknown" if missing>,
  "shop_id": <str, default: "unknown" if missing>
  # optional
  "data": <dict, for additional data>  # not used right now
}

out:

{"result": 1, "message": "OK", "response": {"match": <bool>}}

/admin_user_stats

in:

{
  "sid": <str>,  # authorization
  "userid": <str>,  # stats for this user
  "shop_id": <str>  # and this shop
}

out:

{"result": 1, "message": "OK", "response": [
    {
      "date": <str, "%Y-%m-%d">  # e.g. "2019-02-01"
      "first": <str, "%Y-%m-%dT%H:%M:%SZ">  # first activity of the day in UTC, e.g. "2019-02-01T08:01:11Z"
      "last": <str, "%Y-%m-%dT%H:%M:%SZ">  # last activity of the day in UTC, e.g. "2019-02-01T18:03:51Z"
      "count": <int>  # total number of actions (calls to check_session)
      "details": <dict>  # <action> -> <count>
    }
]}

in:

{"from_time": <str>, "to_time": <str>, "resolution": <hour, day, month>, "userid": <str>, "shop_apikey": <str>}

Zeiten als String in der Form: 2015-12-06 11:55

“resolution”: “hour” nicht möglich bei stats_color

out:

{"result": 1, "message": "OK", "response": {"sum_list": {<int>: {"time": <str_date>, "sum": <int>}, ... }}}

Anmerkung:

Der Zeitstempel (z.B. “2015-11-30 10:00:00.000”) meint den Beginn der Zeitspanne (Beisp. endet hier bei “2015-11-30 10:59:59.999)

/stats_color

in:

{"from_time": <str>, "to_time": <str>, "resolution": <hour, day, month>, "userid": <str>, "shop_apikey": <str>}

Zeiten als String in der Form: 2015-12-06 11:55

“resolution”: “hour” nicht möglich bei stats_color

out:

{"result": 1, "message": "OK", "response": {"sum_list": [{"time": <str_date>, "sum": <int>}, ... ]}}

Anmerkung:

Der Zeitstempel (z.B. “2015-11-30 10:00:00.000”) meint den Beginn der Zeitspanne (Beisp. endet hier bei “2015-11-30 10:59:59.999)

/categories (deprecated use get_field_values instead)

in:

{"userid": <str>, "shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {"categories":[{"name": <str>, "count": <int>, "gender": <str,"None">, "f_value": <float,"no f_value">, "available": <bool,"no available_info"}]}}

/get_field_values

Alle Werte im Feed (unified) anzeigen:

in:

{"userid": <str>, "shop_apikey": <str>, "field_name": <str> (categories, brands, colors, shops, season)}

out:

{"result": 1, "message": "OK", "response": {"field_values":[...]}}

categories:
{"name": <str>, "count": <int>, "gender": <str,Null>, "f_value": <float,Null>, "available": <bool,default:true}

brands, colors, shops, gender, season:
{"brand/color/shop/gender/season": <str>, "size": <int>}

Nur die Werte innerhalb einer Kategorie (unified) anzeigen:

in:

{"userid": <str>, "shop_apikey": <str>, "field_name": <str> (brands, colors, shops, gender, season), "category": <str>}

out:

{"result": 1, "message": "OK", "response": {"field_values":[<str>]}}

/get_categories_translation

in:

{"shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {"translation":{<cat_int, str>: <cat_visulytics, str>, ...}}}

/update_categories_cache

(for internal use only)

in:

{"shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {}}

/save_f_value

in:

{"userid": <str>, "shop_apikey": <str>, "category": <str>, "f_value": <float>, "gender": <str,None>}

out:

{"result": 1, "message": "OK", "response": {}}

/get_f_values

in:

{"userid": <str>, "shop_apikey": <str>, "categories": [<str>]}
{"userid": <str>, "shop_apikey": <str>, "categories": [<str>], "gender": <str>}

out:

{"result": 1, "message": "OK", "response": {"f_values": {"category": <str>, "f_value": <float>, "gender": <str>}}}

:?: Bitte categories auf encoding Probleme testen.

/save_mapping

in:

{"userid": <str>, "shop_apikey": <str>, "customer_cat": <str>, "picalike_cat": <str>, "visual": <bool, None>, "gender": <str,None>}

out:

{"result": 1, "message": "OK", "response": {}}

/get_mapping

in:

{"userid": <str>, "shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {"mapping": [{"customer_cat": <str>, "picalike_cat": <str>, "suggested_cat": <str>, "gender": <str>, "visual": <bool>}]}}

/picalike_categories

in:

{"userid": <str>}

out:

{"result": 1, "message": "OK", "response": {"categories": [<str>]}}

/picalike_fashion_categories

in:

{"userid": <str>}

out:

{"result": 1, "message": "OK", "response": {"categories": [[<str>, <str>], ...]}}

/products

in:

{"userid": <str>, "shop_apikey": <str>, "page": <int,0>, "limit": <int,50>, "sort_key_direction": <str,{"ASC"(default), "DESC"}>}
{"userid": <str>, "shop_apikey": <str>, "cat_name": <str>, "page": <int,0>, "limit": <int,50>}
{"userid": <str>, "shop_apikey": <str>, "gender": <str>, "page": <int,0>, "limit": <int,50>}
{"userid": <str>, "shop_apikey": <str>, "available": <bool>, "page": <int,0>, "limit": <int,50>}
{"userid": <str>, "shop_apikey": <str>, "season": <str>, "page": <int,0>, "limit": <int,50>}
{"userid": <str>, "shop_apikey": <str>, "type": <str>, "page": <int,0>, "limit": <int,50>}
{"userid": <str>, "shop_apikey": <str>, "color": <str>, "pColor": <bool>, "page": <int,0>, "limit": <int,50>}  
{"userid": <str>, "shop_apikey": <str>, "page": <int,0>, "limit": <int,50>, "filter_price": {"lower": <float,0>, "upper": <float,1e6>}}
{"userid": <str>, "shop_apikey": <str>, "cat_name": <str>, "page": <int,0>, "limit": <int,50>, "filter_price": {"lower": <float,0>, "upper": <float,1e6>}}
filter_price ist nachgelagern, Anzahl der Produkte kann kleiner sein als limit. Filterung auf gesammten Daten möglich aber teurer.
gender, available, cat_name, season, type und color können kombiniert werden
wenn "color" ein picalikeColor ist, muss "pColor": true ("pColor": false für "color" aus dem Feed)
mittels "unify": true können die Bilder-Urls auf Einmaligkeit gefiltert werden (möglichst nur mit cat_name, ist bei großen Datenmengen sehr langsam)

out:

{"result": 1, "message": "OK", "response": {"products":[{"name": <str>, "price": <str>, "url": <str>, "imgid": <str>, "deeplink": <str>, "gender": <str>, "season": <str>, "type": <str>, "color": <str>}]}}

/products_by_random

in:

{"userid": <str>, "shop_apikey": <str>, "limit": <int,50>}

out:

{"result": 1, "message": "OK", "response": {"products":[{"name": <str>, "price": <str>, "url": <str>, "imgid": <str>, "deeplink": <str>, "gender": <str>}]}}

/product_by_views

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "productid": <str>}
{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "productid": <str>, "resolution": <hour, day, month>}
Zeiten als String in der Form: 2015-12-06 11:55

out:

{"result": 1, "message": "OK", "response": {"product_count": <int>}}
{"result": 1, "message": "OK", "response": {"product_count": <int>, "sum_list": {<int>: {"time": <str_date>, "sum": <int>}, ... }}}

/product_by_views_30

in:

{"userid": <str>, "shop_apikey": <str>, "productid": <str>}

out:

{"result": 1, "message": "OK", "response": {"product_count": <int>, "sum_list": {<int>: {"time": <str_date>, "sum": <int>}, ... }}}

/top_views

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "limit": <int,10>}
Zeiten als String in der Form: 2015-12-06 11:55
mittels "update_cache": <egal> kann der cache in der mongo neu geschrieben werden

out:

{"result": 1, "message": "OK", "response": {"top_views": [{"productid": <str>, "amount": <int>}]}}
Bei gleicher Häufigkeit ist die Sortierung undefiniert.

/get_products_metaData

in:

{"userid": <str>, "shop_apikey": <str>, "productids": [<str>], "cat_name": <str>, "image_id_delimiter": <char>, "n_image_id_chunks": <int>, "extra_fields": <list of strings>}
Optional:
cat_name - filter by cat,
image_id_delimiter - split image_id at delimiter,
n_image_id_chunks - number of chunks to keep,
extra_fields

out:

{"result": 1, "message": "OK", "response": {"products":[{"name": <str, None>, "price": <str, None>, "url": <str, None>, "imgid": <str, None>, "deeplink": <str, None>, "available": <bool, None>, "cat": <str, None>, "season": <str>, "type": <str>, "color": <str>, "pColor": <str>}]}}

out_with_extra_field(s):

The ouput is exactly the same as for a request without any option, but the query from the pci app to MongoDB pcistyles collection will only respond with items containing the field extra_image_filter with the value extra_image_exists.

/colors

in:

{"userid": <str>, "shop_apikey": <str>}
{"userid": <str>, "shop_apikey": <str>, "category": [<str>], "gender": <str>}
category und gender optional und frei kombinierbar

out:

{"result": 1, "message": "OK", "response": {"related_products": <int>, "color_statistic":[{"color_name": <str>, "avg_amount": <float>, "found_count": <int>, "found_percent": <float>}]}}

related_products: Anzahl der gefundenen Produkte
avg_amount: Durchschnittlicher Anteil dieser Farbe in allen Bildern die diese Farbe haben
found_count: Anzahl der Bilder die diese Farbe haben
found_percent: (found_count / related_products)

/get_colors

in:

{"userid": <str>, "shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {"color_names":[<str>]}}

/search_by_color

in:

{"userid": <str>, "shop_apikey": <str>, "color_name": <str>, "limit": <int,10>, "page": <int,0>}
{"userid": <str>, "shop_apikey": <str>, "color_name": <str>, "limit": <int,10>, "page": <int,0>, "cat_name": <str>, "gender": <str>}
cat_name und gender optional und frei kombinierbar

out:

{"result": 1, "message": "OK", "response": {"products":[{"productid": <str>, "amount": <float>}]}}
products sind absteigend sortiert nach Anteil der Farbe am Produkt

/colors_by_views

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>}
Zeiten als String in der Form: 2015-12-06 11:55

out:

{"result": 1, "message": "OK", "response": {"related_products": <int>, "color_statistic":[{"color_name": <str>, "amount": <int>]}}

/color_filter

Returns a list of all colors in a feed or a list of all picalike colors if the former is not available.

in:

{"userid": <str>, "shop_apikey": <str>,"pColor": <bool>}
"pColor": true forces use of picalike colors

out:

{"result": 1, "message": "OK", "response": {"colors": [<str>], "pColor": <bool>}}
"pColor": true if picalike colors are returned

/replace_product

in:

{"userid": <str>, "shop_apikey": <str>, "ref_pid": <str>, "new_prod": <dict with product info>}

out:

{"result": 1, "message": "OK", "response": {"num_updated_styles": <int>}}

/save_style

in:

{"userid": <str>, "shop_apikey": <str>, "name": <str>, "type": <str>, "order_by": <int>, "products": <dict of products>}

out:

{"result": 1, "message": "OK", "response": {"styleid": <str>, "userid": <str>, "name": <str>, "type": <str>, "modified": double, "created": double, "visibility": <str>, "products": <list of products>}}

/copy_style_to_shop

this will replace some SKUs for Atelier Goldner Schnitt if the following settings are present in the feed settings:

in:

{"userid": <str>, "from_shop_apikey": <str>, "to_shop_apikey": [<str>], "styleid": [<str>]}

out:

{"result": 1, "message": "OK", "response": 
  {<to_shop_apikey>: 
    {"copied": [<str>], 
     "errors": [{styleid: <str>, "msg": <str>}], 
     "missing": [{styleid: <str>, "prod_ids": [<str>]}]
    }
  }
}

/check_style_name

in:

{"shop_apikey": <str>, "name": <str>}

out:

{"result": 1, "message": "OK", "response": {"exists": <bool>}}

/update_style

in:

{"styleid": <str>, "shop_apikey": <str>, ...}

out:

{"result": 1, "message": "OK", "response": {...}}

/get_style

in:

{"styleid": <str>, "shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {...}}

/style_count

in:

{"shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {"style_count": <int>}}

/style_cover

in:

{"shop_apikey": <str>}
{"shop_apikey": <str>, "renew": <bool>}

out:

{"result": 1, "message": "OK", "response": {"all": <float>, <cat_name>: <float>, ...}}

/list_styles

in:

{"shop_apikey": <str>, "limit": <int,150>, "page": <int,0>}

out:

{"result": 1, "message": "OK", "response": [...]}

/list_all_styles

in:

{"shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": [...]}

/update_styles_cache

in:

{"shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {}}

/delete_style

in:

{"styleid": <str>, "shop_apikey": <str>, "userid": <str>}

out:

{"result": 1, "message": "OK", "response": {}}

/all_recoboxes

in:

{"userid": <str>, "shop_apikey": <str>,}

out:

{"result": 1, "message": "OK", "response": [{"userid": <str>, "shop_apikey": <str>, "box_id": <str>, "reco_type": (look|sim)<str>, "mode": (live|preview)<str>, "referrer": <boolean>, "only_if_unavailable": <boolean>, "box_name": <str>, "creation_time": <int>, "status": (active|deleted)<str>, "template": <str>}]}

Falls keine Recobox gespeichert ist, ist der Wert von response eine leerer Array. Der Wert von creation_time ist im Format “seconds since epoch”.

/read_recobox

in:

{"userid": <str>, "shop_apikey": <str>, "box_id": <str>}

out:

{"result": 1, "message": "OK", "response": [{"userid": <str>, "shop_apikey": <str>, "box_id": <str>, "reco_type": (look|sim)<str>, "mode": (live|preview)<str>, "referrer": <boolean>, "only_if_unavailable": <boolean>, "box_name": <str>, "creation_time": <int>, "status": (active|deleted)<str>, "template": <str>, "regex": <str>}]}

Falls keine Recobox vorhanden ist, ist der Wert von response eine leerer Array. Der Wert von creation_time ist im Format “seconds since epoch”.

/delete_recobox

in:

{"userid": <str>, "shop_apikey": <str>, "box_id": <str>}

out:

{"result": 1, "message": "OK", "response": {"matched_count": <int>}}

Der Wert von matched_count ist die Anzahl der auf status=deleted gesetzten Einträge.

/save_recobox

in:

{"userid": <str>, "shop_apikey": <str>, "box_id": <str>,
"reco_type": <str>, "mode": (live|preview)<str>, "box_name": <str>, "template": <str>, "regex": <str>,
"referrer": <boolean>, "only_if_unavailable": <boolean>}

Alle Parameter außer “userid”, “shop_apikey”, “box_id” sind optional. Boolean wird hier wie folgt interpretiert: ein leerer String ist false und ein nicht-leerer String true.

out:

{"result": 1, "message": "OK", "response": {}}

/edit_recobox

in:

{"userid": <str>, "shop_apikey": <str>, "box_id": <str>,
"reco_type": (sim|look)<str>, "mode": (live|preview)<str>, "box_name": <str>, "template": <str>, "regex": <str>,
"referrer": <boolean>, "only_if_unavailable": <boolean>}

Alle Parameter außer “userid”, “shop_apikey”, “box_id” sind optional. Boolean wird hier wie folgt interpretiert: ein leerer String ist false und ein nicht-leerer String true.

out:

{"result": 1, "message": "OK", "response": {}}

/stats_clicks

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>}

oder:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "testid": <str>, "test_class": <str>}

Zeiten als String in der Form: 2015-12-06 11:55 “test_class” ist z.B. “A”

out:

{"result": 1, "message": "OK", "response": {"click_stats": {<type>: {<datum> : <int>}}, "todays_prediction": {<type>: <int>}}}

<type> in der Form “sim_*” oder “look_*”

<datum> als String in der Form: 2015-12-06

“todays_prediction” ist nicht leer nur wenn “to_time” == heute

/stats_checkouts

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>}

oder

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "testid": <str>, "test_class": <str>}

Zeiten als String in der Form: 2015-12-06 11:55 “test_class” ist z.B. “A”

out:

{"result": 1, "message": "OK", "response": {"checkout_stats": [{"date": <str>, "not_found": <int>, "products": <int>, "value": <int>, "checkouts": <int>, "sessions": <int>}], "todays_prediction": {"sessions": <int>, "checkouts": <int>}}}

“date” in der Form: 2015-12-06

“value” als Cents

“todays_prediction” ist nicht leer nur wenn “to_time” == heute

/top_clicked

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "limit": <int>}

Zeiten als String in der Form: 2015-12-06 11:55

out:

{"result": 1, "message": "OK", "response": {"top_clicked": [[imgId, n_clicks], ...]}}

“top_clicked” ist eine high-to-low sortierte Liste.

/ab_config/create

in:

{"userid": <str>, "shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "status": <bool>, "prob_a": <float>, "name": <str>, "testid": <str>, "description": <str>}

from_time und to_time als String im Format: “2015-11-30 10:00”.

status (activity status)

prob_a (probability parameter in real-valued range [0, 1], i.e. 0.856)

out:

{"result": 1, "message": "OK", "response": {"status": <str>, "testid": <str>}}

/ab_config/get_ab_tests

in

{"userid": <str>, "shop_apikey": <str>}

out:

{"result": 1, "message": "OK", "response": {"ab_tests": [{"shop_apikey": <str>, "from_time": <str>, "to_time": <str>, "status": <bool>, "prob_a": <float>, "name": <str>, "testid": <str>, "description": <str>}]}}

/trend_create

Parameters and files are passed as form fields (content-type=multipart/form-data)

in:

userid=<str>, name=<str>, sources=<list>, gender=<str>, age=<list>, weather=<list>, segment=<list>, categories=<list>, country=<list>, status=<str>, hashtags=<str>, description=<str>, image_i=new, file_i=<file>, style_i=<list>, cpc_i=<list>

out:

{"result": 1, "message": "OK", "response": {"trendid": <str>}}

/trend_info

in:

{"userid": <str>, "trendid": <str>}

out:

{"result": 1, "message": "OK", "response": {"trend_info": {"userid": <str>, "name": <str>, "trendid": <str>, "created": <str>, "edited": <str>, "sources" [<str>, ...], "gender": <str>, "age": [<str>, ...], "weather": [<str>, ...], "segment": [<str>, ...], "categories": [<str>, ...], "country": [<str>, ...], "status": {"preview", "active, "deleted"}, "hashtags": <str>, "description": <str>, "images": {"image_1": {"file_id": <str>, "style": <str>, "cpc": <str>}, "image_2": {"file_id": <str>, "style": <str>, "cpc": <str>}, ...}}}}

/trend_edit

Parameters and files are passed as form fields (content-type=multipart/form-data)

in:

userid=<str>, name=<str>, sources=<list>, gender=<str>, age=<list>, weather=<list>, segment=<list>, categories=<list>, country=<list>, status=<str>, hashtags=<str>, description=<str>, image_i=<cmd>, file_i=<file>, style_i=<list>, cpc_i=<list>

out:

{"result": 1, "message": "OK", "response": {}}

/trend_delete

in:

{"userid": <str>, "trendid": <str>}

out:

{"result": 1, "message": "OK", "response": {}}

/trend_list

in:

{"userid": <str>, "status": [<str>, ...], "n_images": <int>}

out:

{"result": 1, "message": "OK", "response": {"trends": [{"trendid": <str>, "name": <str>, "created": <str>, "userid": <str>, "status": <str>, "categories": [<str>, ...], "images": [<str>, ...]}, ...}}

/trend_image/<file_id>

Image with database _id = file_id is returned

/upload

Parameters and files are passed as form fields (content-type=multipart/form-data)

in:

{userid:<str>, image_1:<file> , "shop_apikey" : <str> }

out:

{"result": 1, "message": "OK", "response":  {"_id":<str> ,  'images_with_fatal_error':<list> ,'urls_with_image_cloud_error': <list> , 'images_without_error': { <key> : "bits": [[bit, value], ...] , "attributes": [[name, value], ...] , "categories": [[name, value], ...] , "free_person": [[name, value], ...] , 'fasterrcnn_microworker_boxes':   [{'x1': <double>, 'x2': <double>, 'score': <str>, 'y2': <double>, 'class': <str>, 'y1': <double> }, ... ] } } }

/get_image/<file_id>

Just a endpoint to the upload system, this endpoint serve as the http link that the tower01 needs to do the predictions. The method send the image from the collection 'pci_upload'.

/upload_list>

in:

{userid:<str> , shop_apikey : <str> }

out:

{"result": 1, "message": "OK", "response": [{"_id":<str> ,"uploadDate"  : <str> , "userid" : <str> } , {"_id": <str> ,"uploadDate" : <str> , "userid" : <str> } ,...  ] }

* Lists all the _id of uploaded images, by shop_apikey, in the upload system.

/upload_view>

in:

{userid:<str> , shop_apikey : <str>, file_id:<str> }

out:

{"result": 1, "message": "OK", "response": {"new_prediction" : {"_id":<str> ,  'images_with_fatal_error':<list> ,'urls_with_image_cloud_error': <list> , 'images_without_error': { <key> : "bits": [[bit, value], ...] , "attributes": [[name, value], ...] , "categories": [[name, value], ...] , "free_person": [[name, value], ...] , 'fasterrcnn_microworker_boxes':   [{'x1': <double>, 'x2': <double>, 'score': <str>, 'y2': <double>, 'class': <str>, 'y1': <double> }, ... ] } } }} 

/get_image_data>

in:

{userid:<str> , shop_apikey : <str>, file_id:<str> }

out:

{"result": 1, "message": "OK", "response": {"_id":<str> ,  'images_with_fatal_error':<list> ,'urls_with_image_cloud_error': <list> , 'images_without_error': { <key> : "bits": [[bit, value], ...] , "attributes": [[name, value], ...] , "categories": [[name, value], ...] , "free_person": [[name, value], ...] , 'fasterrcnn_microworker_boxes':   [{'x1': <double>, 'x2': <double>, 'score': <str>, 'y2': <double>, 'class': <str>, 'y1': <double> }, ... ] } } }
   

/set_style_exact_match

in:

{userid:<str> , shop_apikey : <str>, styleid:<str>, exact_match: <bool> }

out:

{"result": 1, "message": "OK", "response": {"exact_match":<bool>} }

Collections