Table of Contents

Dashboard API

Host: sg02.picalike.copex-kunden.de

Port: 9091

Dependencies

git

Im git zu finden als:

$ git clone ssh://picalike@dev01.picalike.corpex-kunden.de/home/picalike/stephan/git/dashboard_api

Allgemeines

Anfragen mit json als post

Antworten:

APIs

/get_number_of_requests

Returns number of requests for looks or similarity within last second or within a given time interval (by resolution second, minute, hour).

in:

time_type: last_second

{"userid": <str>, "time_type": "last_second", "information_type": <str> (sim, look)}

time_type: interval

{"userid": <str>, "time_type": "interval", "from_time": <str>, "to_time": <str>, "information_type": <str> (sim, look), "resolution": <str> (second, minute, hour)}

Dabei sind “from_time” und “to_time” im Format: “2017-02-20 16:18:31”. Die Bedingung an das Feld date in der Datenbank ist: to_time > date >= from_time.

out:

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

/get_number_of_requests_by_country

Returns number of requests aggregated by country_code for looks or similarity within last second or within a given time interval (by resolution second, minute, hour). The value of the field “response” is a dictionary with keys country_code and values the number of requests.

in:

time_type: last_second

{"userid": <str>, "time_type": "last_second", "information_type": <str> (sim, look)}

time_type: interval

{"userid": <str>, "time_type": "interval", "from_time": <str>, "to_time": <str>, "information_type": <str> (sim, look), "resolution": <str> (second, minute, hour)}

Dabei sind “from_time” und “to_time” im Format: “2017-02-20 16:18:31”. Die Bedingung an das Feld date in der Datenbank ist: to_time > date >= from_time.

out:

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

/get_last_product_ids

Returns last #limit product ids (that were recorded).

in:

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

out:

{"result": 1, "message": <str>, "response": [{"shop_apikey": <str>, "product_id": <int>}, ...]}}}

/all_countries

Liste aller Länder (aus der country_mapping.json Datei).

in:

{"userid": <str>}

out:

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