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

Faataaraa API

Customers

Interventions

2 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/interventions

Tapura i te mau ohipa

E faaho‘i i te mau ohipa tamâraa atoa.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
pageintegerAniraaAitaNumera api (tumu: 1).1
limitintegerAniraaAitaRahiraa pahonoraa i te api (teitei: 100).25
sortstringAniraaAitaAnairaa e au i te taio mahana o te ohipa (asc aore ra desc, tumu: desc).desc

E titauhia te haapapuraa API.

Mau otia aniraa:60 / miniti1200 / hora4800 / mahana

Hi‘oraa aniraa · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/interventions?page=1&limit=25&sort=desc' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions?page=1&limit=25&sort=desc", {
    "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/interventions?page=1&limit=25&sort=desc');
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/interventions?page=1&limit=25&sort=desc", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

Hi‘oraa pahonoraa

{
    "metadata": {
        "page": 1,
        "limit": 25,
        "total_items": 120,
        "total_pages": 5,
        "sort": "desc"
    },
    "nodes": [
        {
            "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
            "status": "pending",
            "scheduled_at": "2024-06-01T08:00:00+10:00",
            "property": {
                "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
                "name": "Villa Moana"
            },
            "is_started": false,
            "booking": {
                "id": "e9d3a5c2-04bf-4a76-9f79-8db3bfc69f8e",
                "guest": "Jane Doe"
            },
            "invoice": {
                "id": "f6a9c1f2-5d7b-4a2d-b1b2-0a7c0d61bcd1"
            },
            "live": {
                "status": "pending",
                "is_done": false,
                "is_validated": false,
                "started_at": null,
                "ended_at": null,
                "is_paid": false
            },
            "accounting": {
                "amount": null,
                "paid_at": null
            }
        }
    ]
}
GET/api/v1/interventions/{id}

Fari‘i i te hoê ohipa

E faaho‘i i te mau haamaramaramaraa no te hoê ohipa.

Mau faataaraa

FaataaraaHuruVahiTitauhiaMau haamaramaramaraa
idstringAraraa‘EFaataaraa araraa titauhia.
purgestringAniraaAitaIa vai ra, e tumâ i te haaputuraa Redis no teie tapa‘o faataa hou a hamani faahou ai i te pahonoraa.1

E haaputuhia te pahonoraa no te 60 tetoni.

Mau otia aniraa:60 / miniti1200 / hora4800 / mahana

Hi‘oraa aniraa · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?purge=1' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?purge=1", {
    "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/interventions/00000000-0000-4000-8000-000000000000?purge=1');
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/interventions/00000000-0000-4000-8000-000000000000?purge=1", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

Hi‘oraa pahonoraa

{
    "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
    "status": "validated",
    "scheduled_at": "2024-06-01T08:00:00+10:00",
    "property": {
        "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "name": "Villa Moana",
        "location": {
            "id": "1c3b6f9d-59c7-4b2b-91f8-9a6f8c01d7c2",
            "address": "PK 5, Route de Temae",
            "address_extend": null,
            "formated_address": "PK 5, Route de Temae, Moorea",
            "city": "Moorea",
            "latitude": "-17.5000",
            "longitude": "-149.8500",
            "landmark": null,
            "created_at": "2024-01-01 08:00:00",
            "updated_at": null,
            "zipcode": "98728",
            "island": {
                "id": "0d2d5e7f-0f8a-4c0f-9fb5-7b31f4a3a2df",
                "name": "Moorea"
            }
        },
        "indoor_area": 120,
        "outdoor_area": 80,
        "bedrooms": 3,
        "bathrooms": 2,
        "guests_capacity": 6,
        "wifi_ssid": "VillaMoana",
        "wifi_password": "secret",
        "wifi_protocol": 2,
        "door_code": "A-1234-B - 5678",
        "parking": "Parking privé"
    },
    "is_started": true,
    "booking": {
        "id": "e9d3a5c2-04bf-4a76-9f79-8db3bfc69f8e",
        "guest": "Jane Doe"
    },
    "invoice": {
        "id": "f6a9c1f2-5d7b-4a2d-b1b2-0a7c0d61bcd1"
    },
    "live": {
        "status": "validated",
        "is_done": true,
        "is_validated": true,
        "started_at": "2024-06-01T08:05:00+10:00",
        "ended_at": "2024-06-01T11:45:00+10:00",
        "is_paid": true
    },
    "accounting": {
        "amount": 15000,
        "paid_at": "2024-06-01T11:45:00+10:00"
    }
}