Skip to main content

Gateways API

The Gateways API provides endpoints for retrieving information about IoT gateways that collect and transmit sensor data from monitored assets. Gateways serve as the communication bridge between sensors and the cloud platform.

Endpoints Overview

MethodEndpointDescription
GET/gatewaysList all gateways
GET/gateways/{id}Get a specific gateway

List Gateways

Retrieves a list of gateways with optional filtering.

Endpoint: GET /gateways

Authentication: Required

Query Parameters:

ParameterTypeDescription
companyNamestringFilter by company name
siteNamestringFilter by site name
gatewayIdstringFilter by gateway identifier
limitintegerMaximum number of results (default: 100)

Response:

{
"items": [
{
"id": "gw-123",
"gatewayId": "GW-PLANT-001",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"name": "Production Floor Gateway",
"location": "Building A, Room 101",
"status": "online",
"firmwareVersion": "2.4.1",
"lastSeen": "2024-10-15T14:30:00Z",
"ipAddress": "192.168.1.100",
"connectedSensors": 12,
"configuration": {
"reportingInterval": 60,
"dataRetention": 24,
"timezone": "America/New_York"
},
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-10-15T14:30:00Z"
}
],
"count": 1,
"nextToken": "eyJpZCI6Imd3LTEyMyJ9"
}

Example Request:

curl -X GET "https://api.acme.f7i.ai/prod/gateways?companyName=Acme%20Corp&siteName=Main%20Plant" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Get Gateway

Retrieves a specific gateway by ID.

Endpoint: GET /gateways/{id}

Authentication: Required

Path Parameters:

ParameterTypeDescription
idstringUnique identifier of the gateway

Response:

{
"id": "gw-123",
"gatewayId": "GW-PLANT-001",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"name": "Production Floor Gateway",
"location": "Building A, Room 101",
"status": "online",
"firmwareVersion": "2.4.1",
"lastSeen": "2024-10-15T14:30:00Z",
"ipAddress": "192.168.1.100",
"macAddress": "AA:BB:CC:DD:EE:FF",
"connectedSensors": 12,
"sensors": [
{
"sensorId": "sensor-001",
"name": "Pump A1 Vibration",
"status": "active"
},
{
"sensorId": "sensor-002",
"name": "Motor B2 Temperature",
"status": "active"
}
],
"configuration": {
"reportingInterval": 60,
"dataRetention": 24,
"timezone": "America/New_York"
},
"networkInfo": {
"signalStrength": -45,
"connectionType": "ethernet"
},
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-10-15T14:30:00Z"
}

Example Request:

curl -X GET "https://api.acme.f7i.ai/prod/gateways/gw-123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Gateway Status Values

StatusDescription
onlineGateway is connected and transmitting data
offlineGateway is not responding
pendingGateway is registered but not yet connected
maintenanceGateway is undergoing maintenance
errorGateway is experiencing issues

Configuration Options

FieldTypeDescription
reportingIntervalintegerData reporting interval in seconds
dataRetentionintegerLocal data retention period in hours
timezonestringGateway timezone (IANA format)

Error Responses

400 Bad Request

{
"error": "Invalid request",
"details": {
"gatewayId": "Invalid gateway ID format"
}
}

404 Not Found

{
"error": "Item not found"
}

500 Internal Server Error

{
"error": "Internal server error: [error details]"
}