# Windows Terminal - Beispielhafte Anfrage

**Beschreibung:**  
Dieser `cURL`-Befehl sendet eine `POST`-Anfrage an die **SmartDog API v2**, um Sensordaten für einen bestimmten Zeitraum abzurufen.  

**Tool:** cURL  
**API-URL:** `https://apiv2.smart-dog.eu/index.php`  
**Methode:** `POST`  

---

### **Code:**
```sh
curl -X POST "https://apiv2.smart-dog.eu/index.php" \
     -H "Content-Type: application/json" \
     -d '{
           "action": "getSensorData",
           "apikey": "6641d282073d76b625987af5141d3e2a",
           "SensorID": "551941",
           "UTC_TIMESTAMP_FROM": "1739867939",
           "UTC_TIMESTAMP_TO": "1739877939"
         }'
```

---

### **Beschreibung der Parameter:**
- `-X POST` → Die Anfrage wird per `POST`-Methode gesendet.  
- `-H "Content-Type: application/json"` → Setzt den Header auf JSON-Daten.  
- `-d '{...}'` → Enthält die zu sendenden JSON-Daten.  

---

### **Beispiel für eine erfolgreiche API-Antwort:**
```json
{
    "sensor_id": 551941,
    "valid": 1,
    "datasets": {
        "1739868002": {
            "DATA": "251",
            "TIMESTAMP_UTC": 1739868002,
            "TIMESTAMP_LOCAL": 1739871602
        },
        "1739868302": {
            "DATA": "257",
            "TIMESTAMP_UTC": 1739868302,
            "TIMESTAMP_LOCAL": 1739871902
        }
    }
}
```

---

### **Alternative mit Ausgabe in einer Datei:**
Falls du die Antwort direkt in einer Datei speichern möchtest:
```sh
curl -X POST "https://apiv2.smart-dog.eu/index.php" \
     -H "Content-Type: application/json" \
     -d '{
           "action": "getSensorData",
           "apikey": "6641d282073d76b625987af5141d3e2a",
           "SensorID": "551941",
           "UTC_TIMESTAMP_FROM": "1739867939",
           "UTC_TIMESTAMP_TO": "1739877939"
         }' > response.json
```
Die Antwort wird dann in `response.json` gespeichert.