A haere i ni'a i te ihirangi
stayclean
Faatereraa i te mau faataaraa
API docsSmartlocker

Faataaraa API

Smartlocker

Codes · Door

7 mau araraa APIREST / JSON

Hi‘oraa taatoa

A faaohipa i te mau araraa e ravea i raro nei. A mono i te mau tapa‘o hi‘oraa e YOUR_API_TOKEN i ta ‘outou iho mau faufaa haamanahia; aita teie api e faatere i te mau hi‘oraa.

URL tumu

https://api.stayclean.io

Haapapuraa

Authorization: Basic YOUR_API_TOKEN

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

Tapura i te mau tapa‘o Smartlocker o te fare

E faaho‘i i te mau tapa‘o atoa faanahohia e to ratou tiaraa faaau.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

{
    "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

Hamani i te tapa‘o Smartlocker

E tuu i te tapa‘o apî no te tapa‘o faataa e faaau i te reira i te tapo‘i opani.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.
identifierstringIhi‘ETapa‘o faataa o te code faanahohia no te fare.vendor
modestringIhiAitaRavea hamaniraa tapa‘o: random aore ra manual.manual
codestringIhiAitaE titauhia i roto i te ravea manual: e 4 e tae atu i te 10 numera i rotopu i te 1 e te 7, haponohia ei string.123456
labelstringIhiAitaI‘oa e ere i te mea titauhia no te tapa‘o araraa.Cleaning access

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare).

Ihi tiaihia: identifier (string), mode ("random"|"manual"), code (string, e titauhia ia mode = manual), label (string e ere i te mea titauhia).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

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

Tumâ i te tapa‘o Smartlocker

E tatara i te tapa‘o i te fare e e tumâ i te reira i te tapo‘i opani maramarama.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.
identifierstringAraraa‘EFaataaraa araraa titauhia.

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare), {identifier} (tapa‘o faataa o te code).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

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

Faahou i te tapa‘o Smartlocker

E faahou i te i‘oa aore ra te faufaa o te tapa‘o e vai ra e e faaau i te tapo‘i opani.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.
identifierstringAraraa‘EFaataaraa araraa titauhia.
modestringIhiAitaRavea hamaniraa tapa‘o: random aore ra manual.manual
codestringIhiAitaE titauhia i roto i te ravea manual: e 4 e tae atu i te 10 numera i rotopu i te 1 e te 7, haponohia ei string.123456
labelstringIhiAitaI‘oa e ere i te mea titauhia no te tapa‘o araraa.Cleaning access

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare), {identifier} (tapa‘o faataa o te code).

Ihi tiaihia: mode ("random"|"manual"), code (string, e titauhia ia mode = manual), label (string e ere i te mea titauhia).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

{
    "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

Faaapî i te tapa‘o Smartlocker

E hamani i te tapa‘o apî no te tapa‘o faataa maitihia e e faahou i te tapo‘i opani.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.
identifierstringAraraa‘EFaataaraa araraa titauhia.
modestringIhiAitaRavea hamaniraa tapa‘o: random aore ra manual.manual
codestringIhiAitaE titauhia i roto i te ravea manual: e 4 e tae atu i te 10 numera i rotopu i te 1 e te 7, haponohia ei string.123456
labelstringIhiAitaI‘oa e ere i te mea titauhia no te tapa‘o araraa.Cleaning access

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare), {identifier} (tapa‘o faataa o te code).

Ihi tiaihia: mode ("random"|"manual"), code (string, e titauhia ia mode = manual), label (string e ere i te mea titauhia).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

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

Opani i te opani o te fare

E haamata i te ohipa opaniraa o te tapo‘i opani maramarama taaihia i te fare.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

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

Iriti i te opani o te fare

E haamata i te ohipa iritiraa o te tapo‘i opani maramarama taaihia i te fare.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.

E taotiahia i te 10 aniraa i te miniti, 100 i te hora e 500 i te mahana.

Mau faataaraa araraa: {id} (UUID o te fare).

Mau otia aniraa:10 / miniti100 / hora500 / mahana

Hi‘oraa aniraa · 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)

Hi‘oraa pahonoraa

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