API & Intégrations
Connectez vos projets externes à ICD Tracker via l'API REST
Tokens actifs
2
Appels (30j)
0
Jours actifs
0
Générer un nouveau token
Tokens existants
GestAbonné
Actif
API-FACT_dd2••••••••
· Créé 2h par Thomas Martin 0
appels / 7j
Jamais
dernier appel
Token principal
Actif
API-FACT_72a••••••••
· Créé 3h 0
appels / 7j
Jamais
dernier appel
Guide d'intégration rapide
Pour connecter un projet externe (GestAbonné, etc.) à ICD Tracker, il suffit d'un appel HTTP. Voici les étapes :
1. Tester la connexion
curl -H "X-API-Token: VOTRE_TOKEN" \
https://suspicious-lamarr.217-160-40-22.plesk.page/api.php?action=ping
2. Créer un ticket depuis votre projet
curl -X POST \
-H "X-API-Token: VOTRE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Erreur formulaire abonné",
"description": "Le formulaire plante quand...",
"type": "bug",
"priority": "high",
"source_url": "https://gestabonne.fr/admin/abonnes",
"source_user": "jean.dupont@client.fr",
"source_app": "GestAbonné v3",
"tags": ["backend", "urgent"]
}' \
https://suspicious-lamarr.217-160-40-22.plesk.page/api.php?action=create_ticket
3. Intégration PHP (à mettre dans votre projet)
<?php
// Fichier : icd_tracker.php (à inclure dans votre projet)
class ICDTracker {
private string $apiUrl;
private string $token;
public function __construct(string $apiUrl, string $token) {
$this->apiUrl = rtrim($apiUrl, '/');
$this->token = $token;
}
public function createTicket(array $data): array {
return $this->request('create_ticket', 'POST', $data);
}
public function getTicket(string $ref): array {
return $this->request("get_ticket&ref=$ref", 'GET');
}
private function request(string $action, string $method, array $data = []): array {
$ch = curl_init($this->apiUrl . "/api.php?action=$action");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Token: ' . $this->token,
'Content-Type: application/json',
],
]);
if ($method === 'POST') {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
}
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true) ?: [];
}
}
// Utilisation :
// $icd = new ICDTracker('https://suspicious-lamarr.217-160-40-22.plesk.page', 'VOTRE_TOKEN');
// $result = $icd->createTicket([
// 'title' => 'Bug formulaire',
// 'type' => 'bug',
// 'priority' => 'high',
// 'source_app' => 'GestAbonné'
// ]);
4. Endpoints disponibles
| Méthode | Action | Description |
|---|---|---|
| GET | ping | Tester la connexion |
| POST | create_ticket | Créer un ticket |
| GET | get_ticket&ref=XX-001 | Consulter un ticket |
| GET | list_tickets | Lister les tickets du projet |
| PUT | update_status | Changer le statut d'un ticket |