Zum Inhalt gehen
stayclean
Dokumentationsnavigation
API docsSmartlocker

API-Referenz

Smartlocker

Codes · Door

7 EndpunkteREST / JSON

Überblick

Verwenden Sie die folgenden Pfade und Methoden. Ersetzen Sie Beispielkennungen und YOUR_API_TOKEN durch Ihre eigenen berechtigten Werte; diese Seite führt keine Beispiele aus.

GET/api/v1/properties/{id}/smartlocker/codes

Smartlocker-Codes einer Unterkunft auflisten

Gibt alle konfigurierten Codes mit ihrem Synchronisationsstatus zurück.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", {
    "method": "GET",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "property_id": "uuid",
    "definitions": [
        {
            "identifier": "vendor",
            "label": "Code prestataire",
            "description": "Code utilisé par l’équipe de nettoyage."
        }
    ],
    "codes": [
        {
            "identifier": "vendor",
            "label": "Code prestataire",
            "description": "Code utilisé par l’équipe de nettoyage.",
            "code": 123456,
            "code_formatted": "123456",
            "configured": true,
            "synced": true
        }
    ]
}
POST/api/v1/properties/{id}/smartlocker/codes

Smartlocker-Code erstellen

Fügt einen neuen Code für eine Kennung hinzu und synchronisiert ihn mit dem Schloss.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.
identifierstringInhaltJaFür die Unterkunft konfigurierte Codekennung.vendor
modestringInhaltNeinCodeerzeugungsmodus: random oder manual.manual
codestringInhaltNeinIm Modus manual erforderlich: 4 bis 10 Ziffern zwischen 1 und 7, als Zeichenfolge gesendet.123456
labelstringInhaltNeinOptionale Bezeichnung des Zugangscodes.Cleaning access

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft).

Erwarteter Inhalt: identifier (string), mode ("random"|"manual"), code (string, erforderlich bei mode = manual), label (optionaler string).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "identifier": "vendor",
    "mode": "manual",
    "code": "123456",
    "label": "Code ménage"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"identifier\": \"vendor\",\n    \"mode\": \"manual\",\n    \"code\": \"123456\",\n    \"label\": \"Code ménage\"\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "identifier": "vendor",
    "mode": "manual",
    "code": "123456",
    "label": "Code ménage"
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"identifier\": \"vendor\",\n    \"mode\": \"manual\",\n    \"code\": \"123456\",\n    \"label\": \"Code ménage\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "success": true,
    "entry": {
        "identifier": "vendor",
        "label": "Code ménage",
        "code": 123456,
        "configured": true,
        "synced": true
    },
    "codes": []
}
DELETE/api/v1/properties/{id}/smartlocker/codes/{identifier}

Smartlocker-Code löschen

Entfernt einen Code von der Unterkunft und löscht ihn vom Smartlock.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.
identifierstringPfadJaErforderlicher Pfadparameter.

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft), {identifier} (Codekennung).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · DELETE

cURL

curl --request 'DELETE' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", {
    "method": "DELETE",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", data=data, headers=headers, method="DELETE")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "success": true,
    "codes": []
}
PUTPATCH/api/v1/properties/{id}/smartlocker/codes/{identifier}

Smartlocker-Code aktualisieren

Aktualisiert Bezeichnung oder Wert eines bestehenden Codes und synchronisiert das Schloss.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.
identifierstringPfadJaErforderlicher Pfadparameter.
modestringInhaltNeinCodeerzeugungsmodus: random oder manual.manual
codestringInhaltNeinIm Modus manual erforderlich: 4 bis 10 Ziffern zwischen 1 und 7, als Zeichenfolge gesendet.123456
labelstringInhaltNeinOptionale Bezeichnung des Zugangscodes.Cleaning access

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft), {identifier} (Codekennung).

Erwarteter Inhalt: mode ("random"|"manual"), code (string, erforderlich bei mode = manual), label (optionaler string).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · PUT

cURL

curl --request 'PUT' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "mode": "manual",
    "code": "654321",
    "label": "Code ménage (soir)"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", {
    "method": "PUT",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"mode\": \"manual\",\n    \"code\": \"654321\",\n    \"label\": \"Code ménage (soir)\"\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "mode": "manual",
    "code": "654321",
    "label": "Code ménage (soir)"
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"mode\": \"manual\",\n    \"code\": \"654321\",\n    \"label\": \"Code ménage (soir)\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", data=data, headers=headers, method="PUT")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "success": true,
    "entry": {
        "identifier": "vendor",
        "label": "Code ménage (soir)",
        "code": 654321,
        "configured": true,
        "synced": true
    },
    "codes": []
}
POST/api/v1/properties/{id}/smartlocker/codes/{identifier}/reset

Smartlocker-Code zurücksetzen

Generiert einen neuen Code für die gewählte Kennung und aktualisiert das Schloss.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.
identifierstringPfadJaErforderlicher Pfadparameter.
modestringInhaltNeinCodeerzeugungsmodus: random oder manual.manual
codestringInhaltNeinIm Modus manual erforderlich: 4 bis 10 Ziffern zwischen 1 und 7, als Zeichenfolge gesendet.123456
labelstringInhaltNeinOptionale Bezeichnung des Zugangscodes.Cleaning access

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft), {identifier} (Codekennung).

Erwarteter Inhalt: mode ("random"|"manual"), code (string, erforderlich bei mode = manual), label (optionaler string).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "mode": "random"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"mode\": \"random\"\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "mode": "random"
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"mode\": \"random\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "success": true,
    "entry": {
        "identifier": "vendor",
        "code": 765432,
        "configured": true,
        "synced": true
    },
    "codes": []
}
POST/api/v1/properties/{id}/smartlocker/door/close

Tür einer Unterkunft verriegeln

Löst die Verriegelung des verbundenen Smartlocks der Unterkunft aus.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "success": true,
    "door_open": true,
    "door_busy": true
}
POST/api/v1/properties/{id}/smartlocker/door/open

Tür einer Unterkunft entriegeln

Löst die Entriegelung des verbundenen Smartlocks der Unterkunft aus.

Parameter

ParameterTypPositionErforderlichDetails
idstringPfadJaErforderlicher Pfadparameter.

Auf 10 Anfragen pro Minute, 100 pro Stunde und 500 pro Tag begrenzt.

Pfadparameter: {id} (UUID der Unterkunft).

Anfragelimits:10 / Minute100 / Stunde500 / Tag

Anfragebeispiel · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Antwortbeispiel

{
    "success": true,
    "door_open": false,
    "door_busy": true
}