Eziwan REST API
The Eziwan REST API lets you integrate the platform with your existing tools—SCADA, ERP, ITSM, BI—or create your own monitoring applications.
Base URL and Authentication
Endpoint
https://api.eziwan.com/v1
Bearer Authentication
All requests require a Bearer API token:
Authorization: Bearer np_api_xxxxxxxxxxxxxxxxxxxxxxxx
Generate a token in Settings → API → Create a token.
Permission levels available per token:
- Read-only: GET only — dashboard, data, status
- Read/Write: GET + POST/PUT — alerts, reboot, configuration
- Admin: full access, including user management and billing
Main Endpoints
Devices
# List all devices
GET /v1/devices
# Detail of a device
GET /v1/devices/{device_id}
# Real-time status (signal, VPN, active SIM)
GET /v1/devices/{device_id}/status
# Connectivity History
GET /v1/devices/{device_id}/connectivity?from=2026-01-01&to=2026-06-01
Sensor Data
# Latest values of all variables for a device
GET /v1/devices/{device_id}/data/latest
# Time series for a variable
GET /v1/devices/{device_id}/data?metric=active_power&from=2026-06-01T00:00:00Z&to=2026-06-01T23:59:59Z&interval=5m
# Export CSV
GET /v1/devices/{device_id}/data/export?format=csv&from=2026-01-01&to=2026-06-30
Alerts
# Active alerts for the organization
GET /v1/organization/alarms/active
# Historique des alertes
GET /v1/organization/alarms?from=2026-06-01&severity=critical
# Clear an alert
POST /v1/alarms/{alarm_id}/acknowledge
Body: { "comment": "Technicien en route" }
# Resolve an alert
POST /v1/alarms/{alarm_id}/resolve
Body: { "comment": "Pompe réparée, retour à la normale" }
Program Initiatives
# Rebooting a device (read/write permission required)
POST /v1/devices/{device_id}/reboot
# Forcer un failover SIM
POST /v1/devices/{device_id}/failover
Body: { "target_sim": 2 }
# Logs d'audit
GET /v1/audit-logs?from=2026-01-01&to=2026-06-30&format=csv
Practical Examples
Python — Retrieving Offline Devices
import requests
API_TOKEN = "np_api_xxxxxxxxxxxxxxxxxxxxxxxx"
BASE_URL = "https://api.eziwan.com/v1"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
# List offline devices
response = requests.get(f"{BASE_URL}/devices", headers=headers)
devices = response.json()["data"]
offline = [d for d in devices if d["status"] == "offline"]
print(f"{len(offline)} dispositifs hors ligne :")
for d in offline:
print(f" - {d['name']} ({d['id']}) — hors ligne depuis {d['last_seen']}")
Python — Retrieving Data from a Sensor
import requests
from datetime import datetime, timedelta
API_TOKEN = "np_api_xxxxxxxxxxxxxxxxxxxxxxxx"
DEVICE_ID = "d_a1b2c3d4"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
# Last 24 hours — active power
response = requests.get(
f"https://api.eziwan.com/v1/devices/{DEVICE_ID}/data",
headers=headers,
params={
"metric": "active_power",
"from": (datetime.utcnow() - timedelta(days=1)).isoformat() + "Z",
"to": datetime.utcnow().isoformat() + "Z",
"interval": "5m"
}
)
data = response.json()["data"]
print(f"{len(data)} points retournés")
for point in data[:5]:
print(f" {point['timestamp']}: {point['value']} {point['unit']}")
curl — Export CSV for Monthly Report
curl -H "Authorization: Bearer np_api_xxxx" \
"https://api.eziwan.com/v1/devices/d_a1b2c3d4/data/export?format=csv&from=2026-06-01&to=2026-06-30" \
-o donnees_juin_2026.csv
Webhooks
Webhooks send events via push notifications to your HTTP endpoint.
Configuration
Dashboard → Alerts → Webhooks → Add a Webhook
Settings:
- URL: Your HTTPS endpoint (e.g.,
https://your-app.com/eziwan-events) - Secret: HMAC-SHA256 key to verify the signature (optional but recommended)
- Events: select the types (device.offline, alarm.triggered, failover, etc.)
Payload Format
{
"event": "device.offline",
"severity": "critical",
"timestamp": "2026-06-15T02:14:33.412Z",
"device": {
"id": "d_a1b2c3d4",
"name": "GW-Valenciennes-03",
"group": "Région Nord / Site Valenciennes",
"tags": ["env:production", "criticite:haute"]
},
"detail": {
"last_seen": "2026-06-15T02:12:01.000Z",
"sim_active": 2,
"rsrp_dbm": -108
},
"dashboard_url": "https://app.eziwan.com/devices/d_a1b2c3d4"
}
Signature Verification
import hmac, hashlib
def verify_eziwan_webhook(payload: bytes, signature: str, secret: str) -> bool:
expected = "hmac-sha256=" + hmac.new(
secret.encode(), payload, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)
# In your Flask/FastAPI handler:
# signature = request.headers.get("X-Eziwan-Signature")
# valid = verify_eziwan_webhook(request.body, signature, WEBHOOK_SECRET)
Upcoming Events
| Event | Trigger |
|---|---|
device.offline | Device offline |
device.online | Back online |
alarm.triggered | Alarm threshold exceeded |
alarm.resolved | Alarm cleared |
failover.activated | Switch from SIM1 to SIM2 |
failover.recovered | Return to SIM1 |
firmware.updated | Firmware update successful |
provisioning.completed | ZTP complete — gateway online |
ITSM Integrations via Webhooks
ServiceNow
// Transformation Script for ServiceNow Integration Hub
(function process(/*RESTAPIRequest*/ request) {
var body = JSON.parse(request.body.dataString);
if (body.event === "device.offline" && body.severity === "critical") {
var incident = new GlideRecord("incident");
incident.short_description = "Gateway Eziwan hors ligne : " + body.device.name;
incident.description = "Site : " + body.device.group + "\nDernier vu : " + body.detail.last_seen;
incident.urgency = "1"; // Haute
incident.impact = "2"; // Moyen
incident.insert();
}
})(request);
Jira Service Management
# Automatically Create a Ticket Using the Jira API
curl -X POST \
-H "Authorization: Bearer JIRA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"project": { "key": "OPS" },
"summary": "Gateway hors ligne : GW-Valenciennes-03",
"description": "Site : Région Nord\nDernier contact : 2026-06-15T02:12:01Z",
"issuetype": { "name": "Incident" },
"priority": { "name": "High" }
}
}' \
"https://"your-instance.atlassian.net/rest/api/3/issue"
Limits and Quotas
| Plan | API Requests/Day | Webhooks | CSV Export |
|---|---|---|---|
| Starter | 1,000 | 2 endpoints | 90 days |
| Growth | 10,000 | 10 endpoints | 1 year |
| Scale | 100,000 | 50 endpoints | 3 years |
| Enterprise | Unlimited | Unlimited | Unlimited |
The complete OpenAPI (Swagger) reference is available at api.eziwan.com/docs.
Frequently Asked Questions
How do I authenticate with the API?
Via a Bearer token generated from the console (with configurable scope and expiration). Tokens are revoked instantly, and each call is logged along with its issuer.
What data is available through the API?
An inventory of equipment and its status (signal, SIM, VPN, firmware), collected data (Modbus, sensors), the alert history, and management actions (restart, configuration push).
Is it possible to receive push notifications instead of polling?
Yes, via webhooks: the platform calls your HTTP endpoint for each selected event (alert, disconnection, threshold exceeded), which is ideal for creating ITSM tickets or feeding data into your existing monitoring system.
Are there any data limits?
Yes, rate limiting protects the platform; the standard quotas more than cover typical integrations and can be adjusted upon request for high-volume usage.
Related Resources
- MQTT Integration — real-time data flow
- Industrial Data Collection — the big picture
- Technical Architecture — where the API fits into the platform
- Machine Fleet Management — managing the fleet via API