LogoLogo
  • Ruuvi Developer Documentation
  • Ruuvi Hardware
    • RuuviTag B
    • RuuviTag Pro
    • Ruuvi Gateway
    • Ruuvi DevShield
    • Ruuvi Connector Kit
    • TMP 117 External Sensor
  • Ruuvi Connector System
    • Introduction
    • Expansion boards
    • Cables
    • Connectors
  • Ruuvi Sensor Firmware
    • 1.2.12
    • 2.5.9
    • 3.X
      • 3.x Sensors
      • 3.x Heartbeat
    • Device Firmware Update (DFU)
  • Ruuvi Gateway Firmware
    • GW Getting Started
    • GW Web-UI
      • Greeting window
      • Internet connection settings
        • Connection via Wi-Fi
        • Connection via Ethernet
      • Software update
      • Automatic configuration download
      • Automatic updates
      • Access Settings from LAN
      • Cloud Options
        • Backend: HTTP(s)
        • Backend: MQTT(s)
        • Backend: Statistics
      • Time Synchronisation Options
      • Bluetooth Scanning Settings
      • Configuration completion
      • Authentication when accessing from LAN
    • GW Install custom firmware
    • GW nRF52811 Firmware
      • GW nRF52811 selftest
      • GW nRF52811 scanning
      • GW nRF52811 repeating
      • GW nRF52811 UART communication
  • GW ESP32 Firmware
    • GW ESP32 WiFi Hotspot
    • GW ESP32 Button
    • GW ESP32 LED
    • GW ESP32 HTTP Client
    • GW ESP32 MQTT client
  • GW Data formats
    • HTTP: Time-stamped data from Bluetooth-sensors
    • HTTP: Data from Bluetooth-sensors without timestamps
    • MQTT: Time-stamped data from Bluetooth-sensors
    • MQTT: Data from Bluetooth-sensors without timestamps
    • HTTP GET /history (with timestamps) and decoding
    • HTTP: Gateway status
    • Gateway configuration
  • GW Examples
    • Polling mode
    • Poll endpoint "/metrics"
    • Configuration update via API
    • Firmware update via API
    • Configuration download from a remote server via API
    • MQTT examples
    • Home Assistant
    • MQTT+AWS IoT Core
  • Communicate with RuuviTag devices via Bluetooth
    • Bluetooth advertisements
      • Data format 3 (RAWv1)
      • Data format 4 (URL)
      • Data format 5 (RAWv2)
      • Data format C5 (Cut-RAWv2)
      • Data format 8 (Encrypted environmental)
    • Bluetooth connection
      • DIS (Device Information Service)
      • NUS (Nordic UART Service)
        • Heartbeat transmissions
        • Read logged history
    • Real Time Transfer (RTT)
  • Communicate with Ruuvi Cloud
    • Ruuvi Cloud
      • User API
      • Gateway API
      • Internal API
      • Alerts
      • Cloud stored app settings
  • Ruuvi Community projects
    • Integrations
Powered by GitBook
On this page
  • whitelist
  • Register a sensor to Cloud
  • Register a subscription to be claimed by user
  • Freebase Cloud Messaging to iOS devices - Proposal 2023-02-08
Edit on GitHub
  1. Communicate with Ruuvi Cloud
  2. Ruuvi Cloud

Internal API

Internal API for Network Management

The Internal API consists of a set of endpoints designed to govern the Ruuvi Network, such as whitelisting and blacklisting devices and/or IP addresses.

whitelist

POST https://network.ruuvi.com/whitelist

Whitelists a set of gateways.

Headers

Name
Type
Description

X-Internal-Secret

string

The secret to authenticate with the internal API

Request Body

Name
Type
Description

object

JSON object containing a list of Gateway Mac Addresses and their corresponding Signing Secrets.

{
  "gateway": "<<MAC>>",
  "blockedAt": <<TIMESTAMP IF BLOCKED>>
}
POST /whitelist
{
    "macAddress": "ab:ba:cd:ba:cd:ba",
    "secret": "1234"
}

GET https://network.ruuvi.com/gwinfo

Fetches info for the gateway

Query Parameters

Name
Type
Description

gateway

string

Gateway Mac Address

Headers

Name
Type
Description

X-Internal-Secret

string

The secret to authenticate with the internal API

{
    "result": "success",
    "data": {
        "gateway": {
            "GatewayId": "<<GATEWAY MAC>>",
            "Whitelisted": <<UNIX TIMESTAMP WHEN WHITELISTED>>,
            "Connected": <<FIRST CONNECTED AFTER WHITELISTING>>,
            "Latest": <<MOST RECENT UPDATE>>,
            "InvalidSignatureTimestamp": <<MOST RECENT SIGNING REJECTION>>
        }
    }
}

Register a sensor to Cloud

POST https://network.ruuvi.com/register-sensor

This operation register a sensor with MAC address + secret to Cloud. The secret can be used to verify ownership of a sensor in case of a contested sensor.

Parameters are packed inside a JSON object, e.g. { "macAddress":"value", "secret":"value"}

Headers

Name
Type
Description

X-Internal-Secret

String

The secret to authenticate with the internal API

Request Body

Name
Type
Description

macAddress*

String

MAC address of sensor, 6 bytes. e.g. "AA:BB:CC:DD:EE:FF

secret*

String

Secret of sensor, e.g. "DE:AD:BE:EF:00:11:22:33

{
    // Response
}
{
    // Response
}
{
    // Response
}

Register a subscription to be claimed by user

POST https://network.ruuvi.com/subscription-register

This endpoint is called by Ruuvi Shop after payment for user subscription is verified. Parameters are in JSON object of body.

Headers

Name
Type
Description

X-Shop-Secret*

String

Ruuvi Shop authentication secret

Request Body

Name
Type
Description

validDays*

String

Validity of subscription, e.g. 365

maxClaims*

Number

Number of sensors user can Claim

maxShares

Number

Number of shares user can have. Defaults to maxClaims * maxSharesPerSensor

maxSharesPerSensor

Number

Number of times one sensor can be shared. Defaults to 10

maxHistoryDays*

Number

Number of days of history user is allowed to retrieve. This does not affect sensors shared to this user.

maxResolutionMinutes*

Number

Best resolution user is allowed to retrieve. This does not affect sensors shared to this user.

subscriptionName

String

Name of subscription. Defaults to "Ultimate" (custom)

claimCode*

String

Code used to claim this subscription

creatorId

String

String id for creator of code, e.g. webshop account which triggered code generation

{
    // Response
}
{
    // Response
}
{
    // Response
}
{
    // Response
}
{
    // Response
}

Freebase Cloud Messaging to iOS devices - Proposal 2023-02-08

POST FCM://iOS

{ "notification":{ "body": $alertData, "title":"Ruuvi $alertType alert: $name" }, "alert":{ "title-loc-key": RUUVI_$alertType, "title-loc-args": [$alertType, $triggertype], "loc-key" : "RUUVI_$alertType_$triggerType", "loc-args" : [ $name, $currentValue, $alertUnit, $thresholdValue, $alertUnit] }, "content_available":1, "mutable-content":1, "token":$token, "email":$email, "type":"alert", "data":{ "name": $name, "id":$sensor_id, "alertType": $alertType, "triggerType": $triggertype, "currentValue": $currentValue, "thresholdValue": $thresholdValue, "alertUnit": $alertUnit, "alertData": $alertData } }

Request Body

Name
Type
Description

alertData

String

User-defined alert title. May be empty string

alertType*

String

Physical quantity of alert, one of: {"Temperature", "Humidity", "Pressure", "Movement", "Voltage", "RSSI", "noData"}

triggerType*

String

Type of violation, one of {"Over", "Under", "Different from"}

name*

String

User-configured sensor name

alertUnit*

String

Unit of alert, e.g. "C", "F", "K"

currentValue*

String

Current value of alerting sensor, in alertUnit units

thresholdValue*

String

Threshold value of alerting sensor, in alertUnit units

token*

String

FCM Token of receiver

sensor_id*

String

MAC Address of alerting senser

email*

String

User email

PreviousGateway APINextAlerts

Last updated 2 years ago

FCM is used to deliver push notifications to user applications. To receive the notification, user must register their device token with a POST to

https://network.ruuvi.com/push-register