{
    "info": {
        "_postman_id": "satf-congo-fleet-api-v1",
        "name": "SATF CONGO FLEET API",
        "description": "Collection Postman pour l'API Fleet v1.\n\nVariables de collection :\n- `baseUrl` : URL de base API (défaut depuis FLEET_API_PUBLIC_URL)\n- `apiToken` : token Bearer client (préfixe sc_)\n\nDocumentation : http://localhost:8000/developers",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{apiToken}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "http://localhost:8000/api/v1"
        },
        {
            "key": "apiToken",
            "value": "sc_your_token_here"
        },
        {
            "key": "vehicleId",
            "value": "1"
        },
        {
            "key": "groupId",
            "value": "1"
        },
        {
            "key": "reportJobId",
            "value": "1"
        },
        {
            "key": "reportTemplateId",
            "value": "1"
        },
        {
            "key": "archiveId",
            "value": "1"
        },
        {
            "key": "webhookId",
            "value": "1"
        }
    ],
    "item": [
        {
            "name": "Vehicles",
            "item": [
                {
                    "name": "List vehicles",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/vehicles?active_only=true",
                            "host": ["{{baseUrl}}"],
                            "path": ["vehicles"],
                            "query": [{"key": "active_only", "value": "true"}]
                        }
                    }
                },
                {
                    "name": "Show vehicle",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/vehicles/{{vehicleId}}"
                    }
                }
            ]
        },
        {
            "name": "Positions",
            "item": [
                {
                    "name": "All vehicle positions",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/vehicles/positions"
                    }
                },
                {
                    "name": "Vehicle position",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/vehicles/{{vehicleId}}/position"
                    }
                }
            ]
        },
        {
            "name": "Groups",
            "item": [
                {
                    "name": "List groups",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/groups"
                    }
                },
                {
                    "name": "Group vehicles",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/groups/{{groupId}}/vehicles"
                    }
                }
            ]
        },
        {
            "name": "History & Reports data",
            "item": [
                {
                    "name": "Vehicle history",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/vehicles/{{vehicleId}}/history?from=2026-05-01T00:00:00Z&to=2026-05-29T23:59:59Z",
                            "host": ["{{baseUrl}}"],
                            "path": ["vehicles", "{{vehicleId}}", "history"],
                            "query": [
                                {"key": "from", "value": "2026-05-01T00:00:00Z"},
                                {"key": "to", "value": "2026-05-29T23:59:59Z"}
                            ]
                        }
                    }
                },
                {
                    "name": "Vehicle trips",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/vehicles/{{vehicleId}}/trips?from=2026-05-01T00:00:00Z&to=2026-05-29T23:59:59Z",
                            "host": ["{{baseUrl}}"],
                            "path": ["vehicles", "{{vehicleId}}", "trips"],
                            "query": [
                                {"key": "from", "value": "2026-05-01T00:00:00Z"},
                                {"key": "to", "value": "2026-05-29T23:59:59Z"}
                            ]
                        }
                    }
                },
                {
                    "name": "Vehicle fuel",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/vehicles/{{vehicleId}}/fuel?from=2026-05-01T00:00:00Z&to=2026-05-29T23:59:59Z",
                            "host": ["{{baseUrl}}"],
                            "path": ["vehicles", "{{vehicleId}}", "fuel"],
                            "query": [
                                {"key": "from", "value": "2026-05-01T00:00:00Z"},
                                {"key": "to", "value": "2026-05-29T23:59:59Z"}
                            ]
                        }
                    }
                }
            ]
        },
        {
            "name": "Sensors & Events",
            "item": [
                {
                    "name": "Vehicle sensors",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/vehicles/{{vehicleId}}/sensors"
                    }
                },
                {
                    "name": "List events",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/events?per_page=50",
                            "host": ["{{baseUrl}}"],
                            "path": ["events"],
                            "query": [{"key": "per_page", "value": "50"}]
                        }
                    }
                }
            ]
        },
        {
            "name": "Report Templates",
            "description": "Modèles de rapports Wialon affectés aux groupes du client. Ability : fleet:read",
            "item": [
                {
                    "name": "List report templates",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/report-templates",
                            "host": ["{{baseUrl}}"],
                            "path": ["report-templates"]
                        }
                    }
                },
                {
                    "name": "Show report template",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/report-templates/{{reportTemplateId}}"
                    }
                },
                {
                    "name": "List report templates (incremental sync)",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/report-templates?since=2026-05-01T00:00:00Z",
                            "host": ["{{baseUrl}}"],
                            "path": ["report-templates"],
                            "query": [{"key": "since", "value": "2026-05-01T00:00:00Z"}]
                        }
                    }
                },
                {
                    "name": "List report templates (with wialon_data)",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": {
                            "raw": "{{baseUrl}}/report-templates?include=wialon_data",
                            "host": ["{{baseUrl}}"],
                            "path": ["report-templates"],
                            "query": [{"key": "include", "value": "wialon_data"}]
                        }
                    }
                },
                {
                    "name": "List group report templates",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/groups/{{groupId}}/report-templates"
                    }
                }
            ]
        },
        {
            "name": "Async Reports",
            "description": "Exécution et suivi de rapports. Ability : fleet:reports",
            "item": [
                {
                    "name": "Generate group report",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"wialon_resource_id\": 23045518,\n  \"wialon_template_id\": 2,\n  \"from\": \"2026-05-01T00:00:00Z\",\n  \"to\": \"2026-05-29T23:59:59Z\",\n  \"label\": \"Fuel May 2026\"\n}"
                        },
                        "url": "{{baseUrl}}/groups/{{groupId}}/reports"
                    }
                },
                {
                    "name": "List stored group reports",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/groups/{{groupId}}/reports"
                    }
                },
                {
                    "name": "List stored reports",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/reports"
                    }
                },
                {
                    "name": "Execute report (Wialon IDs)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"wialon_group_id\": 20837054,\n  \"wialon_resource_id\": 23045518,\n  \"wialon_template_id\": 2,\n  \"from\": \"2026-05-01T00:00:00Z\",\n  \"to\": \"2026-05-29T23:59:59Z\",\n  \"format\": \"json\",\n  \"label\": \"Fuel May 2026\"\n}"
                        },
                        "url": "{{baseUrl}}/reports/execute"
                    }
                },
                {
                    "name": "Execute report (unit + wialon_unit_id)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"wialon_group_id\": 20837054,\n  \"wialon_resource_id\": 23045518,\n  \"wialon_template_id\": 2,\n  \"wialon_unit_id\": 1001,\n  \"from\": \"2026-05-01T00:00:00Z\",\n  \"to\": \"2026-05-29T23:59:59Z\"\n}"
                        },
                        "url": "{{baseUrl}}/reports/execute"
                    }
                },
                {
                    "name": "Execute report (legacy type)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"type\": \"trips\",\n  \"wialon_unit_id\": 1001,\n  \"from\": \"2026-05-01T00:00:00Z\",\n  \"to\": \"2026-05-29T23:59:59Z\",\n  \"format\": \"json\"\n}"
                        },
                        "url": "{{baseUrl}}/reports/execute"
                    }
                },
                {
                    "name": "Execute report (gateway IDs)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"gateway_group_id\": {{groupId}},\n  \"gateway_template_id\": {{reportTemplateId}},\n  \"from\": \"2026-05-01T00:00:00Z\",\n  \"to\": \"2026-05-29T23:59:59Z\",\n  \"format\": \"json\",\n  \"label\": \"Fuel May 2026\"\n}"
                        },
                        "url": "{{baseUrl}}/reports/execute/gateway"
                    }
                },
                {
                    "name": "Execute group report (gateway IDs)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"gateway_template_id\": {{reportTemplateId}},\n  \"from\": \"2026-05-01T00:00:00Z\",\n  \"to\": \"2026-05-29T23:59:59Z\",\n  \"format\": \"json\"\n}"
                        },
                        "url": "{{baseUrl}}/groups/{{groupId}}/reports/gateway"
                    }
                },
                {
                    "name": "Show report job",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/reports/{{reportJobId}}"
                    }
                },
                {
                    "name": "List report job Wialon archives",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/reports/{{reportJobId}}/wialon-responses"
                    }
                },
                {
                    "name": "Show report job Wialon archive",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/reports/{{reportJobId}}/wialon-responses/{{archiveId}}"
                    }
                }
            ]
        },
        {
            "name": "Webhooks",
            "item": [
                {
                    "name": "List webhooks",
                    "request": {
                        "method": "GET",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/webhooks"
                    }
                },
                {
                    "name": "Create webhook",
                    "request": {
                        "method": "POST",
                        "header": [
                            {"key": "Accept", "value": "application/json"},
                            {"key": "Content-Type", "value": "application/json"}
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"url\": \"https://client.example.com/webhooks/fleet\",\n  \"events\": [\"vehicle.position.updated\", \"vehicle.event.created\"]\n}"
                        },
                        "url": "{{baseUrl}}/webhooks"
                    }
                },
                {
                    "name": "Delete webhook",
                    "request": {
                        "method": "DELETE",
                        "header": [{"key": "Accept", "value": "application/json"}],
                        "url": "{{baseUrl}}/webhooks/{{webhookId}}"
                    }
                }
            ]
        }
    ]
}
