Call device using cul

How to get an API key

  • Login to mdash.net
  • Click on "Keys" tab
  • Click on the API key to copy it to the clipboard

List device's RPC functions

$ curl https://mdash.net/api/v2/devices/DEVICE_ID/rpc/RPC.List?access_token=API_KEY
[
  "Sys.Reboot",
  "Sys.GetInfo",
  ...
]

Call device's custom RPC function

$ curl -H 'Content-Type: application/json' \
       -d '{"pin": 2}' \
       https://mdash.net/api/v2/devices/DEVICE_ID/rpc/GetTemperature?access_token=API_KEY
23.4

See device shadow

$ curl https://mdash.net/api/v2/devices/DEVICE_ID?access_token=API_KEY
{
  "id": ...,
  "shadow": { .... }
}

Change device shadow

$ curl -H 'Content-Type: application/json' \
       -d '{"shadow":{"state":{"reported":{"message":"hello"}}}}' \
       https://mdash.net/api/v2/devices/DEVICE_ID?access_token=API_KEY
{
  "id": ...,
  "shadow": { .... }
}