Documentation API v1.0

API de partage de position GPS en temps réel

Récupérer un partage

Obtenir les détails d'un partage spécifique

GET /api/v1/shares/{share_id}

Description

Récupère les informations détaillées d'un partage existant via son identifiant unique.

Paramètres URL

share_id (string, requis) - L'identifiant unique du partage

Exemples de code

PHP
<?php
$shareId = 123;
$url = "https://api.fleetlize.fr/api/v1/shares/" . $shareId;
$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer VOTRE_CLE_API",
    "Content-Type: application/json"
]);

$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($statusCode === 200) {
    $data = json_decode($response, true);
    print_r($data);
} else {
    echo "Erreur : " . $response;
}

curl_close($ch);
?>

Réponse exemple

200 OK
{
    "success": true,
    "data": {
        "share_id": 123,
        "token": "abc123def456ghi789jkl012",
        "url": "https://share.fleetlize.fr/share/map?token=abc123def456ghi789jkl012",
        "expires_at": "2025-01-20T14:30:00.000Z",
        "is_active": true,
        "total_views": 42,
        "last_accessed_at": "2025-01-19T16:45:00.000Z",
        "created_at": "2025-01-19T14:30:00.000Z",
        "config": {
            "tracker_ids": [1],
            "refresh_rate": 10,
            "map_config": {
                "theme": "light",
                "language": "fr",
                "centerOnTracker": true
            },
            "route_config": {
                "waypoints": [
                    {"lat": 42.768139, "lng": 1.488861, "label": "Départ"},
                    {"lat": 42.763846, "lng": 1.479987, "label": "Arrivée"}
                ],
                "showRoute": true,
                "showEta": true
            },
            "display_config": {
                "showSpeed": true,
                "showAddress": true,
                "showLastUpdate": true
            },
            "vehicle_info": {}
        }
    }
}