====== 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: * als json * immer “message” und “result” * negativer “result” bedeutet Error * positiver “result” ist Grund zur Hoffnung * in “response” steht die Antwort auf die Frage ===== 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": , "time_type": "last_second", "information_type": (sim, look)} time_type: interval {"userid": , "time_type": "interval", "from_time": , "to_time": , "information_type": (sim, look), "resolution": (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": , "response": {"count": }} ==== /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": , "time_type": "last_second", "information_type": (sim, look)} time_type: interval {"userid": , "time_type": "interval", "from_time": , "to_time": , "information_type": (sim, look), "resolution": (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": , "response": {"country_code": "count"}} ==== /get_last_product_ids ==== Returns last #limit product ids (that were recorded). **in:** {"userid": , "limit": } **out:** {"result": 1, "message": , "response": [{"shop_apikey": , "product_id": }, ...]}}} ==== /all_countries ==== Liste aller Länder (aus der country_mapping.json Datei). **in:** {"userid": } **out:** {"result": 1, "message": , "response": ["country", ...]}