Skip to content
AndroAdi edited this page Jan 10, 2020 · 1 revision

REST API Reference

Every API call must be authenticated by sending Authorization: Bearer KEY HTTP header. Those API calls that use POST or PUT, should specify application/json mime type. Example - calling device's RPC function:

curl -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer API_KEY' \
  -d '{"pin": 2}' \
  https://dash.mongoose-os.com/api/v2/devices/DEVICE_ID/rpc/GPIO.Toggle
true

GET /devices

List all registered devices. Params: none.

POST /devices

Register new device. Params: none.

POST /devices/:id

Change device properties. Params:

{
  "name": "MyCoolDeviceName",
  "shared_with": "github_user1,github_user2",
  "shadow": ...
}

Any key in the params is optional.

DELETE /devices/:id

Delete device. Params: none.

POST /devices/:id/rpc/:func

Call device's RPC function. Params: any valid JSON string, which is expected by the function.

POST /devices/:id/ota

Perform device OTA. Params: a binary content of the firmware .zip file. Example: curl -v -F [email protected] URL.

GET /devices/:id/data

Get device saved data. Params: none.

GET /keys

List all API keys. Params: none.

POST /keys

Create an API key. Params: none.

DELETE /keys/:id

Delete an API key. Params: none.

POST /logs

Get stored notification logs. Params: {"start": 0} - an offset to start from.

GET /devices/data

Get data from all devices. Params: none.

CCM

kiwi

mdash

mongoose-os





ADS1X1X I2C ADS7843/XPT2046 SPI APDS9960 I2C ATCA BH1730 sensor BME280/BMP280 BQ27421 Barometers Bosch BM222 CCS811 I2C DHT DS3231 I2C Dallas RMT ESP32 touch sensor HTU21D(F) I2C ILI9341 SPI IMU INA219 I2C INA226 I2C INA3221 I2C Inventek ISM43xxx WiFi MAX7219 I2C MAX72xx LED matrix MCP23XXX I2C MCP9808 I2C MQ135 gas sensor Neopixel Onewire RMT PCF857X I2C SHT31 I2C SSD1306 OLED STMPE610 SPI Si7005 sensor Si7021 I2C TI TMP006 temp sensor VEML6075 I2C VFS (LittleFS) VFS (RAM) VFS (SPI NOR Flash) VFS (SPIFFS) VFS (Winbond W25XXX) VFS (another device) VFS (encryption) VFS bh1750 I2C



RPC core RPC loopback RPC over BLE GATT RPC over MQTT RPC over UART RPC over UDP Service - ATCA Service - Config Service - Cron Service - FS Service - GATT client Service - GPIO Service - I2C Service - OTA Service - WiFi


uart-gateway

Clone this wiki locally