Ü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)
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
market_id
, product_id
, quantity
(0 (wenig) - 100 (viel))bulk
mit attr market_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
)
product_id
fehlt, wird jeweils der gesamte bekannte Supermarktbestand zurückgeliefert. Ansonsten der gefilterte Bestand.zip
liefert alle Märkte mit entsprechender PLZ.longitude
und latitude
liefert Märkte um die gegebenen Koordinaten mit Radius radius
.GPS
-Koordinaten übergeben, wird zip
ignoriert.radius
ist 1000m details_requested
false
: Es werden keine Bestandsinformationen zurückgeliefert -> für bessere Performancetrue
(default): Es werden zusätzlich zu den Marktinformationen auch der vorhandene Bestand übergebenAntwort: 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_id
u. close_day_id
: (INT) ID {0-6}, mit 0 = Sonntag (Bsp: 3 = Mittwoch)open_time
u. close_time
: (TEXT) Zeit im Format "hh:mm"open_day_short
u. close_day_short
: (TEXT) Tag in Kurzform. (Mo,Di,Mi,Do,Fr,Sa,So)open_day
u. 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 supermarket
mit 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_id
u. close_day_id
: (INT) ID {0-6}, mit 0=Sonntag (Bsp: 3 = Mittwoch)open_time
u. close_time
: (TEXT) Zeit im Format "hh:mm"open_day_short
u. close_day_short
: (TEXT) Tag in Kurzform. (Mo,Di,Mi,Do,Fr,Sa,So)open_day
u. 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"
product_name
ist name des neuen Produktes, product_id
wird ignoriertproduct_id
zu modifizierendes Produkt, product_name
Neuer name des Produktesproduct_id
zu löschendes Produkt, product_name
wird ignoriertAntwort: 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 EANAntwort: 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.
Antwort: result
result
: “success” or “error”Beispiel: Json Input
{
"operation":"create",
"ean": "0401234567890",
"product_id": 1
}
Json Output
{
"result": "success"
}