Go to content
stayclean
Documentation navigation
API docsQuick start

Essential guides

Quick start

Prepare your credentials and make a first read request.

Request API access from our team, choose a documented GET operation and replace YOUR_API_TOKEN with your assigned token. Replace path identifiers and adapt query parameters before running the example in your own environment. Check the HTTP status before decoding the JSON response.

Request example

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)
Explore the reference