FR
DeutschEnglishРусскийEspañolFrançais
Essai gratuit
FonctionnalitésTarifsSécurité et confidentialitéSe connecter
API

API : clients et rapports

Pour agences et hébergeurs : listez les clients avec leur état et récupérez automatiquement les rapports mensuels avec votre logo.

GET /customers

Lister les clients · Lecture

Clients issus de l’association des serveurs, avec nombre de serveurs, alertes critiques et élevées ouvertes et dernier signalement.

Exemple d’appel

cURL
curl -sSf "https://app.tyrosec.com/api/v1/customers" \
  -H "Authorization: Bearer $TYROSEC_TOKEN" \
  -H "Accept: application/json"
Python
import os
import requests

resp = requests.request(
    "GET",
    "https://app.tyrosec.com/api/v1/customers",
    headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/customers');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FAILONERROR => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));
JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/customers", {
  headers: {
    Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
    Accept: "application/json",
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());

Exemple de réponse HTTP 200

{
  "data": [
    {
      "name": "Beispiel-Shop GmbH",
      "servers": 2,
      "open_alerts": {
        "critical": 4,
        "high": 4
      },
      "last_seen": "2026-11-18T15:27:47+00:00"
    },
    {
      "name": "Kanzlei Muster",
      "servers": 1,
      "open_alerts": {
        "critical": 2,
        "high": 1
      },
      "last_seen": "2026-11-18T15:27:47+00:00"
    }
  ]
}

GET /customers/{name}/report.pdf

Rapport mensuel d’un client (PDF) · Lecture

Le rapport mensuel en PDF, avec le nom et le logo de votre agence. Sans month, le mois en cours ; 404 si le client n’a pas de serveur.

ParamètreEmplacementTypeObligatoireDescription
namecheminstringouinom du client (encodé pour l’URL)
monthqueryYYYY-MMnonmois, p. ex. 2026-10

Exemple d’appel

cURL
curl -sSf "https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf?month=2026-10" \
  -H "Authorization: Bearer $TYROSEC_TOKEN" \
  -o report.pdf
Python
import os
import requests

resp = requests.request(
    "GET",
    "https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf",
    headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
    params={"month": "2026-10"},
    timeout=30,
)
resp.raise_for_status()
with open("report.pdf", "wb") as f:
    f.write(resp.content)
PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf?month=2026-10');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FAILONERROR => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
file_put_contents('report.pdf', $out);
JavaScript
import { writeFile } from "node:fs/promises";

const res = await fetch("https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf?month=2026-10", {
  headers: {
    Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
    Accept: "application/json",
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await writeFile("report.pdf", Buffer.from(await res.arrayBuffer()));

Exemple de réponse HTTP 200

Réponse : un fichier PDF (Content-Type application/pdf).

En deux minutes, voyez ce qui se passe sur votre serveur.

Installez l'agent en une ligne de commande, attendez l'inventaire initial, c'est tout. 14 jours gratuits, jusqu'à 3 serveurs, sans carte bancaire.