Bei Fragen/Unklarheiten einfach melden. Kleine Fehler können sich eingeschlichen haben, wir bitten euch darum uns diese mitzuteilen. :)
Übermitteln neuer Bestandsinformationen an einem Supermarkt
Supermärkte nach Standort (und Produkt) abfragen
Supermarkt anlegen, ändern, löschen
Abfrage aller Produktkategorien
Produktkategorie anlegen, ändern, löschen
POST /market/stock
https://wvvcrowdmarket.herokuapp.com/ws/rest/market/stock
Anfrage: market_id (prio 1, optional wenn google_id), maps_id (prio 2, optional wenn market_id ), JSON Liste von product_id (optional)
- Falls keine
product_id-Liste übermittelt wird besteht die Rückgabe aus dem gesamten im Store bekannten Sortimentsbestand.
Antwort: JSON Liste product_id, product_name, quantity
Beispiel: Json Input 1
{
"market_id": 1,
"product_id": [1, 2]
}Json Input 2
{
"maps_id": lkfdsJKJD83KJDkdk,
"product_id": [1, 2]
}
Json Output
{
"result": "success",
"product": [ {
"product_id": 1,
"product_name": "test",
"availability": 50,
"emoji": xyz
}
]
}POST /market/transmit
https://wvvcrowdmarket.herokuapp.com/ws/rest/market/transmit
Anfrage: 2 Möglichkeiten
- JSON mit
market_id,product_id,quantity(0 (wenig) - 100 (viel)) - JSON mit JSON
bulkmit attrmarket_id,product_id,quantity
Beispiel: Json Input 1
{
"market_id": 1,
"product_id": 1,
"quantity": 100
} Json Input 2
{
“bulk”: [{
"market_id": 1,
"product_id": 1,
"availability": 100
},
{...Another Product...}
]
}Json Output
{
"result": "success"
}POST /market/scrape
https://wvvcrowdmarket.herokuapp.com/ws/rest/market/scrape
Anfrage: JSON mit attr zip und/oder longitude, latitude, radius (in Meter, optional), JSON Liste von product_id (optional), details_requested (deprecated durch /market/details)
- Falls JSON Liste
product_idfehlt, wird jeweils der gesamte bekannte Supermarktbestand zurückgeliefert. Ansonsten der gefilterte Bestand. - Anfrage mit
zipliefert alle Märkte mit entsprechender PLZ. - Anfrage mit
longitudeundlatitudeliefert Märkte um die gegebenen Koordinaten mit Radiusradius. - Sind
GPS-Koordinaten übergeben, wirdzipignoriert. - Default
radiusist 1000m details_requestedfalse: Es werden keine Bestandsinformationen zurückgeliefert -> für bessere Performancetrue(default): Es werden zusätzlich zu den Marktinformationen auch der vorhandene Bestand übergeben
Antwort: JSON Liste, in der jedes Element einen Supermarkt mit seinem angefragten Sortiment darstellt.
JSON Liste supermarkt mit Elementen bestehend aus market_id,maps_id, market_name, city, zip, street, longitude, latitude, icon_url, distance(in Meter), periods, JSON Liste products des Warenbestandes mit Elementen bestehend aus product_id, product_name, quantity (optional je nach details_requested)
periods: JSON mit den folgenden Einträgen. Sind keine Öffnungszeiten bekannt, wird eine leere Liste zurück geliefert.open_day_idu.close_day_id: (INT) ID {0-6}, mit 0 = Sonntag (Bsp: 3 = Mittwoch)open_timeu.close_time: (TEXT) Zeit im Format "hh:mm"open_day_shortu.close_day_short: (TEXT) Tag in Kurzform. (Mo,Di,Mi,Do,Fr,Sa,So)open_dayu.close_day: (TEXT) Ausgeschriebener Tag. (Bsp: "Sonntag")
Beispiel: Json Input
{
"zip": Number (Beispiel: 12345),
"gps_length": String (Beispiel: 8.878),
"gps_width": String (Beispel: 45.34),
"radius": Number (Beispiel: 100),
"product_id":
{
1, 2
}
}Json Output
[ {
"market_id": Number (Beispiel: 2),
"maps_id": String (Beispiel: "rx59ghdk"),
"market_name": String (Beispiel: "Rewe"),
"city": String (Beispiel: "Berlin"),
"zip": Number (Beispiel: 12345),
"street": String (Beispiel: "Frommhagenstraße 10"),
"lat": String (Beispiel: "52.5221422"),
"lng": String (Beispiel: "13.4034652"),
"distance": Number (Beispiel: 500),
“icon_url”: String (Beispiel: http://www.sampleurl.de),
“periods”:[
{
“open_day_id”: 1,
“open_time”: “07:00”,
“open_day”: “Montag”,
“open_day_short”: “Mo”,
“close_day_id”: 1,
“close_time”: "22:00",
“close_day”: “Montag”,
“close_day_short”: “Mo”
},
{...weitere Öffnungsperiode...}
],
"products": [
{
"id": Number (Beispiel: 1),
"name": String (Beispiel: "Milch"),
"availability": Number (Beispiel: 43),
"emoji": xyz
},
{
"id": Number (Beispiel: 2),
"name": String (Beispiel: "Eis"),
"availability": Number (Beispiel: 74),
"emoji": xyz
}]
},
{...weiterer Supermarkt und Bestandsinformationen...}
]POST /market/details
https://wvvcrowdmarket.herokuapp.com/ws/rest/market/details
Anfrage: JSON mit market_id oder maps_id (Google Maps POI-ID)
Antwort: JSON mit result, Liste supermarketmit Marktinformationen, sowie dem erfassten Bestand
periods: JSON mit den folgenden Einträgen. Sind keine Öffnungszeiten bekannt, wird eine leere Liste zurück geliefert.open_day_idu.close_day_id: (INT) ID {0-6}, mit 0=Sonntag (Bsp: 3 = Mittwoch)open_timeu.close_time: (TEXT) Zeit im Format "hh:mm"open_day_shortu.close_day_short: (TEXT) Tag in Kurzform. (Mo,Di,Mi,Do,Fr,Sa,So)open_dayu.close_day: (TEXT) Ausgeschriebener Tag. (Bsp: "Sonntag")
Beispiel: Json Input
{"market_id": 47}
Oder
{"maps_id": "ChIJiT47naRPqEcRkuiNMlhUlAY"}
{Json Output
{
"result": "success",
"supermarket": {
"market_id": 47,
"market_name": "REWE",
"city": "Berlin",
"street": "Karl-Marx-Straße 92-98",
"longitude": "13.4358774",
"latitude": "52.4798766",
"maps_id": "ChIJi47naRPqcRkuiNMlhUlAY",
“icon_url”: String (Beispiel: http://www.sampleurl.de),
“periods”:[
{
“open_day_id”: 1,
“open_time”: “07:00”,
“open_day”: “Montag”,
“open_day_short”: “Mo”,
“close_day_id”: 1,
“close_time”: "22:00",
“close_day”: “Montag”,
“close_day_short”: “Mo”
},
{...weitere Öffnungsperiode...}
],
"products": [
{
"product_id": 26,
"product_name": "Fisch",
"availability": 100,
"emoji": xyz
},
{
"product_id": 162,
"product_name": "Nudeln",
"availability": 65,
"emoji": xyz
}
]
}
}POST /market/manage
https://wvvcrowdmarket.herokuapp.com/ws/rest/market/manage
Anfrage: JSON operation(“create”, “modify”, “delete”), market_id, market_name, city, zip, street, longitude, latitude
Antwort: result (“success” or “error”)
Beispiel: Json Input Anlegen
{
"operation":"create",
"market_name":"REWE",
"city":"Bad Nauheim",
"zip":"61231",
"street":"Georg-Scheller-Strasse 2-8",
"longitude":"8.754167",
"latitude":"50.361944"
}Json Input Ändern
{
"operation":"modify",
"market_id":7,
"market_name":"REWE",
"city":"Bad Nauheim",
"zip":"61231",
"street":"Georg-Scheller-Strasse 2-10",
"longitude":"8.754167",
"latitude":"50.361944"
}Json Input Löschen
{
"operation":"delete",
"market_id":9
}Json Output
{
"result": "success"
}POST /product/scrape
https://wvvcrowdmarket.herokuapp.com/ws/rest/product/scrape
Liefert eine Liste aller verfügbaren Produktkategorien zurück.
Anfrage:
Antwort: JSON Liste mit Elementen bestehend aus product_id, prodect_name, emoji
Beispiel: Json Input
{}Json Output
{
"result": "success",
"product": [
{"product_id": 1, "product_name": "Milch", "emoji": 🥛},
{"product_id": 3, "product_name": "Kartoffeln", "emoji": 🥔}
]
}POST /product/manage
https://wvvcrowdmarket.herokuapp.com/ws/rest/product/manage
Anfrage: operation, product_id, product_name
operation: "create", "modify" or "delete"- create:
product_nameist name des neuen Produktes,product_idwird ignoriert - modify:
product_idzu modifizierendes Produkt,product_nameNeuer name des Produktes - delete:
product_idzu löschendes Produkt,product_namewird ignoriert
- create:
Antwort: result
result: “success” or “error”
Beispiel: Json Input
{
"operation":"create",
"product_id": 1,
"product_name":"Milch"
}Json Output
{
"result": "success"
}POST /product_ean/scrape
https://wvvcrowdmarket.herokuapp.com/ws/rest/product_ean/scrape
Anfrage: JSON mit ean
ean: 8- oder 13-stellige EAN
Antwort: JSON result, product_id, product_name
result: “success” or “error”
Beispiel: Json Input
{
"ean":"0401234567890"
}Json Output
{
"result": "success",
"product_id": 1,
"product_name": "Milch"
}POST /product_ean/manage
https://wvvcrowdmarket.herokuapp.com/ws/rest/product_ean/manage
Anfrage: JSON mit ean, product_id
ean: 8- oder 13-stellige EANproduct_id: interne product_id, der die übergebene EAN zugeordnet werden soll.- siehe dazu: /product/scrape
Antwort: result
result: “success” or “error”
Beispiel: Json Input
{
"operation":"create",
"ean": "0401234567890",
"product_id": 1
}
Json Output
{
"result": "success"
}