Skip to content

Gateways

A gateway is a device that is collecting and transmitting the data to the system.

Fetching gateways

You can easily fetch all gateways. Returned data will contain:

  • basic information about gateway (id, name, etc.)
  • last communication timestamp and interval

Endpoint

GET /easy/v1/gateways

Example requests

export ACCESS_TOKEN="ACCESS_TOKEN"
curl --header "Authorization: Bearer $ACCESS_TOKEN" \
    "https://api.rayleighconnect.net/easy/v1/gateways.json"
const ACCESS_TOKEN = 'ACCESS_TOKEN';
const api = new rayleighconnect.EasyAPI(ACCESS_TOKEN);
// API call returns a Promise object:
api.fetchGateways().then(console.log).catch(console.error);
from rayleighconnect import EasyAPI

ACCESS_TOKEN = 'ACCESS_TOKEN'

api = EasyAPI(ACCESS_TOKEN)
# API call returns a list or None or error:
gateways = api.fetch_gateways()

Example responses

[
    {
        "id": "Q123456789",
        "name": "Headquarters",
        "timestamp": "2020-01-02T15:22Z" // ISO 8601 compliant UTC timestamp
        "interval": 60 // communication interval in seconds
    },
    {
        "id": "Q123456799",
        "name": "Factory",
        "timestamp": "2020-01-02T15:22Z" // ISO 8601 compliant UTC timestamp
        "interval": 60 // communication interval in seconds
    }
]
id,name,timestamp,interval
Q123456789,"Headquarters",2020-01-02T15:22Z,60
Q123456799,"Factory",2020-01-02T15:22Z,60