Offene Schnittstelle
Unterkünfte
Die Lieferadresse einer Buchung kommt immer aus dieser Liste. Ein Gast tippt keine Adresse frei ein, sonst fährt der Fahrer an eine Stelle, die es nicht gibt. Ein Eintrag mit isDepot: true steht für die Abholung im Shop.
Unterkünfte auflisten
Abschnitt betitelt „Unterkünfte auflisten“GET/api/ext/v1/accommodations
In der Abfrage
| Parameter | Typ | Bedeutung |
|---|---|---|
q | string | Sucht in Name, Ort und Straße.max. 120 Zeichen |
limit | integer | Höchstzahl der Einträge.1 bis 500 · Vorgabe 100 |
includeInactive | boolean | true zeigt auch stillgelegte Unterkünfte.Vorgabe false |
Felder der Antwort
| Feld | Typ | Bedeutung |
|---|---|---|
accommodations | object[] | Die Unterkünfte, die häufigsten zuerst. |
accommodations[].id | integer | ab -9007199254740991 |
accommodations[].name | string | Name der Unterkunft. |
accommodations[].street | string | Straße und Hausnummer. |
accommodations[].zip | string | Postleitzahl. |
accommodations[].city | string | Ort. |
accommodations[].country | string | Land, ISO 3166-1 alpha-2. |
accommodations[].district | string,null | Ortsteil. |
accommodations[].lat | number,null | Breitengrad. Aus den Koordinaten rechnet der Server Lieferzone und Tour. |
accommodations[].lng | number,null | Längengrad. |
accommodations[].placeId | string,null | Kennung des Ortes bei Google Places. Schützt vor Dubletten: eine vergebene Kennung führt zu 409. |
accommodations[].contactName | string,null | Ansprechperson im Haus. |
accommodations[].contactPhone | string,null | Telefonnummer der Ansprechperson. |
accommodations[].driverNote | string,null | Hinweis für den Fahrer. Steht auf dem Tagesauftrag und nie in einer öffentlichen Liste. |
accommodations[].isDepot | boolean | true für den Eintrag „Abholung im Shop“. |
accommodations[].active | boolean | false für stillgelegte Unterkünfte. |
accommodations[].bookingCount | integer | Anzahl der Buchungen in diesem Haus.ab -9007199254740991 |
curl "https://skirent.sumware.at/api/ext/v1/accommodations?q=Dorfstra%C3%9Fe&limit=10" \ -H "Authorization: Bearer $SKI4ME_KEY"const res = await fetch("https://skirent.sumware.at/api/ext/v1/accommodations?q=Dorfstra%C3%9Fe&limit=10", { headers: { Authorization: `Bearer ${process.env.SKI4ME_KEY}`, },});
const data = await res.json();if (!res.ok) throw new Error(`${data.error.code}: ${data.error.hint}`);console.log(data);import osimport requests
res = requests.get( "https://skirent.sumware.at/api/ext/v1/accommodations", params={"q": "Dorfstraße", "limit": "10"}, headers={"Authorization": f"Bearer {os.environ['SKI4ME_KEY']}"}, timeout=10,)data = res.json()if not res.ok: raise RuntimeError(f"{data['error']['code']}: {data['error']['hint']}")print(data)<?php
$ch = curl_init('https://skirent.sumware.at/api/ext/v1/accommodations?q=Dorfstra%C3%9Fe&limit=10');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SKI4ME_KEY'), ],]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = json_decode($body, true);if ($status >= 400) { throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['hint']);}print_r($data);Antwort200OK
{ "accommodations": [ { "id": 6, "name": "Gasthof Talblick", "street": "Dorfstraße 30", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Unterdorf", "lat": 47.2488, "lng": 13.2052, "placeId": null, "contactName": null, "contactPhone": null, "driverNote": null, "isDepot": false, "active": true, "bookingCount": 0 }, { "id": 2, "name": "Hotel Alpenhof", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Oberdorf", "lat": 47.2533, "lng": 13.2071, "placeId": "ChIJalpenhofBergdorf0001", "contactName": "Rezeption", "contactPhone": "+43 000 000010", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage.", "isDepot": false, "active": true, "bookingCount": 0 } ]}q sucht in Name, Ort und Straße. Die Häuser mit den meisten Buchungen stehen vorn.
Eine Unterkunft lesen
Abschnitt betitelt „Eine Unterkunft lesen“GET/api/ext/v1/accommodations/{id}
Im Pfad
| Parameter | Typ | Bedeutung |
|---|---|---|
id | string | Die Nummer der Unterkunft. |
curl "https://skirent.sumware.at/api/ext/v1/accommodations/2" \ -H "Authorization: Bearer $SKI4ME_KEY"const res = await fetch("https://skirent.sumware.at/api/ext/v1/accommodations/2", { headers: { Authorization: `Bearer ${process.env.SKI4ME_KEY}`, },});
const data = await res.json();if (!res.ok) throw new Error(`${data.error.code}: ${data.error.hint}`);console.log(data);import osimport requests
res = requests.get( "https://skirent.sumware.at/api/ext/v1/accommodations/2", headers={"Authorization": f"Bearer {os.environ['SKI4ME_KEY']}"}, timeout=10,)data = res.json()if not res.ok: raise RuntimeError(f"{data['error']['code']}: {data['error']['hint']}")print(data)<?php
$ch = curl_init('https://skirent.sumware.at/api/ext/v1/accommodations/2');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SKI4ME_KEY'), ],]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = json_decode($body, true);if ($status >= 400) { throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['hint']);}print_r($data);Antwort200OK
{ "id": 2, "name": "Hotel Alpenhof", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Oberdorf", "lat": 47.2533, "lng": 13.2071, "placeId": "ChIJalpenhofBergdorf0001", "contactName": "Rezeption", "contactPhone": "+43 000 000010", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage.", "isDepot": false, "active": true, "bookingCount": 0}Eine Unterkunft anlegen
Abschnitt betitelt „Eine Unterkunft anlegen“POST/api/ext/v1/accommodations
Ist placeId gesetzt und schon vergeben, antwortet der Server mit 409 und nennt den vorhandenen Eintrag. Dieselbe Stelle zweimal anzulegen ist der häufigste Weg zu einer Dublette.
Im Rumpf
| Feld | Typ | Bedeutung |
|---|---|---|
namePflicht | string | Name der Unterkunft.mind. 1 Zeichen · max. 200 Zeichen |
street | string | Straße und Hausnummer.max. 200 Zeichen · Vorgabe `` |
zip | string | Postleitzahl.max. 20 Zeichen · Vorgabe `` |
city | string | Ort.max. 120 Zeichen · Vorgabe `` |
country | string | Land, ISO 3166-1 alpha-2.genau 2 Zeichen · Vorgabe AT |
district | string | null | Ortsteil.max. 120 Zeichen |
lat | number | null | Breitengrad. Aus den Koordinaten rechnet der Server Lieferzone und Tour.-90 bis 90 |
lng | number | null | Längengrad.-180 bis 180 |
placeId | string | null | Kennung des Ortes bei Google Places. Schützt vor Dubletten: eine vergebene Kennung führt zu 409.max. 200 Zeichen |
contactName | string | null | Ansprechperson im Haus.max. 120 Zeichen |
contactPhone | string | null | Telefonnummer der Ansprechperson.max. 60 Zeichen |
driverNote | string | null | Hinweis für den Fahrer. Steht auf dem Tagesauftrag und nie in einer öffentlichen Liste.max. 500 Zeichen |
isDepot | boolean | true für den Eintrag „Abholung im Shop“.Vorgabe false |
curl -X POST "https://skirent.sumware.at/api/ext/v1/accommodations" \ -H "Authorization: Bearer $SKI4ME_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Hotel Alpenhof", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Oberdorf", "lat": 47.2533, "lng": 13.2071, "placeId": "ChIJalpenhofBergdorf0001", "contactName": "Rezeption", "contactPhone": "+43 000 000010", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage." }'const res = await fetch("https://skirent.sumware.at/api/ext/v1/accommodations", { method: "POST", headers: { Authorization: `Bearer ${process.env.SKI4ME_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Hotel Alpenhof", street: "Dorfstraße 12", zip: "5999", city: "Bergdorf", country: "AT", district: "Oberdorf", lat: 47.2533, lng: 13.2071, placeId: "ChIJalpenhofBergdorf0001", contactName: "Rezeption", contactPhone: "+43 000 000010", driverNote: "Skiraum im Untergeschoss, Zugang über die Garage.", }),});
const data = await res.json();if (!res.ok) throw new Error(`${data.error.code}: ${data.error.hint}`);console.log(data);import osimport requests
res = requests.post( "https://skirent.sumware.at/api/ext/v1/accommodations", headers={"Authorization": f"Bearer {os.environ['SKI4ME_KEY']}"}, json={ "name": "Hotel Alpenhof", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Oberdorf", "lat": 47.2533, "lng": 13.2071, "placeId": "ChIJalpenhofBergdorf0001", "contactName": "Rezeption", "contactPhone": "+43 000 000010", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage.", }, timeout=10,)data = res.json()if not res.ok: raise RuntimeError(f"{data['error']['code']}: {data['error']['hint']}")print(data)<?php
$ch = curl_init('https://skirent.sumware.at/api/ext/v1/accommodations');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SKI4ME_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'name' => 'Hotel Alpenhof', 'street' => 'Dorfstraße 12', 'zip' => '5999', 'city' => 'Bergdorf', 'country' => 'AT', 'district' => 'Oberdorf', 'lat' => 47.2533, 'lng' => 13.2071, 'placeId' => 'ChIJalpenhofBergdorf0001', 'contactName' => 'Rezeption', 'contactPhone' => '+43 000 000010', 'driverNote' => 'Skiraum im Untergeschoss, Zugang über die Garage.', ]),]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = json_decode($body, true);if ($status >= 400) { throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['hint']);}print_r($data);Antwort201Created
{ "id": 2, "name": "Hotel Alpenhof", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Oberdorf", "lat": 47.2533, "lng": 13.2071, "placeId": "ChIJalpenhofBergdorf0001", "contactName": "Rezeption", "contactPhone": "+43 000 000010", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage.", "isDepot": false, "active": true, "bookingCount": 0}Aus lat und lng rechnet der Server die Lieferzone und die Reihenfolge der Tour. Geben Sie die Koordinaten mit, wenn Sie sie haben.
Ist placeId gesetzt und schon vergeben, antwortet der Server mit 409 und nennt den vorhandenen Eintrag. Dieselbe Stelle zweimal anzulegen ist der häufigste Weg zu einer Dublette.
curl -X POST "https://skirent.sumware.at/api/ext/v1/accommodations" \ -H "Authorization: Bearer $SKI4ME_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Alpenhof Hotel", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "placeId": "ChIJalpenhofBergdorf0001" }'const res = await fetch("https://skirent.sumware.at/api/ext/v1/accommodations", { method: "POST", headers: { Authorization: `Bearer ${process.env.SKI4ME_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Alpenhof Hotel", street: "Dorfstraße 12", zip: "5999", city: "Bergdorf", placeId: "ChIJalpenhofBergdorf0001", }),});
const data = await res.json();if (!res.ok) throw new Error(`${data.error.code}: ${data.error.hint}`);console.log(data);import osimport requests
res = requests.post( "https://skirent.sumware.at/api/ext/v1/accommodations", headers={"Authorization": f"Bearer {os.environ['SKI4ME_KEY']}"}, json={ "name": "Alpenhof Hotel", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "placeId": "ChIJalpenhofBergdorf0001", }, timeout=10,)data = res.json()if not res.ok: raise RuntimeError(f"{data['error']['code']}: {data['error']['hint']}")print(data)<?php
$ch = curl_init('https://skirent.sumware.at/api/ext/v1/accommodations');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SKI4ME_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'name' => 'Alpenhof Hotel', 'street' => 'Dorfstraße 12', 'zip' => '5999', 'city' => 'Bergdorf', 'placeId' => 'ChIJalpenhofBergdorf0001', ]),]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = json_decode($body, true);if ($status >= 400) { throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['hint']);}print_r($data);Antwort409Conflict
{ "error": { "code": "conflict", "message": "\"Hotel Alpenhof\" steht schon in der Liste.", "status": 409, "hint": "Den vorhandenen Eintrag bearbeiten statt einen zweiten anzulegen.", "documentation_url": "https://skirent.sumware.at/api/" }}Eine Unterkunft ändern
Abschnitt betitelt „Eine Unterkunft ändern“PATCH/api/ext/v1/accommodations/{id}
Im Pfad
| Parameter | Typ | Bedeutung |
|---|---|---|
id | string | Die Nummer der Unterkunft. |
Im Rumpf
| Feld | Typ | Bedeutung |
|---|---|---|
name | string | Name der Unterkunft.mind. 1 Zeichen · max. 200 Zeichen |
street | string | Straße und Hausnummer.max. 200 Zeichen · Vorgabe `` |
zip | string | Postleitzahl.max. 20 Zeichen · Vorgabe `` |
city | string | Ort.max. 120 Zeichen · Vorgabe `` |
country | string | Land, ISO 3166-1 alpha-2.genau 2 Zeichen · Vorgabe AT |
district | string | null | Ortsteil.max. 120 Zeichen |
lat | number | null | Breitengrad. Aus den Koordinaten rechnet der Server Lieferzone und Tour.-90 bis 90 |
lng | number | null | Längengrad.-180 bis 180 |
placeId | string | null | Kennung des Ortes bei Google Places. Schützt vor Dubletten: eine vergebene Kennung führt zu 409.max. 200 Zeichen |
contactName | string | null | Ansprechperson im Haus.max. 120 Zeichen |
contactPhone | string | null | Telefonnummer der Ansprechperson.max. 60 Zeichen |
driverNote | string | null | Hinweis für den Fahrer. Steht auf dem Tagesauftrag und nie in einer öffentlichen Liste.max. 500 Zeichen |
isDepot | boolean | true für den Eintrag „Abholung im Shop“.Vorgabe false |
active | boolean | false für stillgelegte Unterkünfte. |
curl -X PATCH "https://skirent.sumware.at/api/ext/v1/accommodations/2" \ -H "Authorization: Bearer $SKI4ME_KEY" \ -H "Content-Type: application/json" \ -d '{ "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "contactName": "Rezeption, Frau Huber", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage. Schlüssel an der Rezeption." }'const res = await fetch("https://skirent.sumware.at/api/ext/v1/accommodations/2", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.SKI4ME_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ street: "Dorfstraße 12", zip: "5999", city: "Bergdorf", contactName: "Rezeption, Frau Huber", driverNote: "Skiraum im Untergeschoss, Zugang über die Garage. Schlüssel an der Rezeption.", }),});
const data = await res.json();if (!res.ok) throw new Error(`${data.error.code}: ${data.error.hint}`);console.log(data);import osimport requests
res = requests.patch( "https://skirent.sumware.at/api/ext/v1/accommodations/2", headers={"Authorization": f"Bearer {os.environ['SKI4ME_KEY']}"}, json={ "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "contactName": "Rezeption, Frau Huber", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage. Schlüssel an der Rezeption.", }, timeout=10,)data = res.json()if not res.ok: raise RuntimeError(f"{data['error']['code']}: {data['error']['hint']}")print(data)<?php
$ch = curl_init('https://skirent.sumware.at/api/ext/v1/accommodations/2');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_CUSTOMREQUEST => 'PATCH', CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SKI4ME_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'street' => 'Dorfstraße 12', 'zip' => '5999', 'city' => 'Bergdorf', 'contactName' => 'Rezeption, Frau Huber', 'driverNote' => 'Skiraum im Untergeschoss, Zugang über die Garage. Schlüssel an der Rezeption.', ]),]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = json_decode($body, true);if ($status >= 400) { throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['hint']);}print_r($data);Antwort200OK
{ "id": 2, "name": "Hotel Alpenhof", "street": "Dorfstraße 12", "zip": "5999", "city": "Bergdorf", "country": "AT", "district": "Oberdorf", "lat": 47.2533, "lng": 13.2071, "placeId": "ChIJalpenhofBergdorf0001", "contactName": "Rezeption, Frau Huber", "contactPhone": "+43 000 000010", "driverNote": "Skiraum im Untergeschoss, Zugang über die Garage. Schlüssel an der Rezeption.", "isDepot": false, "active": true, "bookingCount": 0}Mit active: false legen Sie ein Haus still, mit active: true kommt es zurück. Buchungen behalten die Adresse, die beim Buchen galt.
Eine Unterkunft entfernen
Abschnitt betitelt „Eine Unterkunft entfernen“DELETE/api/ext/v1/accommodations/{id}
Hängen Buchungen daran, wird sie stillgelegt statt gelöscht (deactivated). Sonst verlöre die Auswertung "welches Haus bringt wieviel" still ihre Zuordnung.
Im Pfad
| Parameter | Typ | Bedeutung |
|---|---|---|
id | string | Die Nummer der Unterkunft. |
Felder der Antwort
| Feld | Typ | Bedeutung |
|---|---|---|
status | string | deleted: gelöscht. deactivated: stillgelegt, weil Buchungen daran hängen.Erlaubt: deactivated, deleted |
Ein Haus ohne Buchungen wird gelöscht:
curl -X DELETE "https://skirent.sumware.at/api/ext/v1/accommodations/6" \ -H "Authorization: Bearer $SKI4ME_KEY"const res = await fetch("https://skirent.sumware.at/api/ext/v1/accommodations/6", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.SKI4ME_KEY}`, },});
const data = await res.json();if (!res.ok) throw new Error(`${data.error.code}: ${data.error.hint}`);console.log(data);import osimport requests
res = requests.delete( "https://skirent.sumware.at/api/ext/v1/accommodations/6", headers={"Authorization": f"Bearer {os.environ['SKI4ME_KEY']}"}, timeout=10,)data = res.json()if not res.ok: raise RuntimeError(f"{data['error']['code']}: {data['error']['hint']}")print(data)<?php
$ch = curl_init('https://skirent.sumware.at/api/ext/v1/accommodations/6');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SKI4ME_KEY'), ],]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = json_decode($body, true);if ($status >= 400) { throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['hint']);}print_r($data);Antwort200OK
{ "status": "deleted"}Hängen Buchungen daran, wird es stillgelegt statt gelöscht. Sonst verlöre die Auswertung, welches Haus wie viel bringt, ihre Zuordnung.
Antwort200OK
{ "status": "deactivated", "bookings": 1}