Skip to content

REST API

Frank Edwards edited this page Nov 12, 2017 · 4 revisions

Home > REST API

This section provides details of Floranet's REST API endpoints. The API is used exclusively by floracmd to perform service configuration and management operations.

Devices

Show Device

Returns JSON data about a single device.

URL

/api/v1.0/device/:deveui

URL Parameters

Required:

deveui=[integer]

Data Parameters

None

Success Response:

Code: 200 OK

Content:

{
    "appeui": 723685415265700877,
    "appname": "azuredevice01",
    "appskey": 283109901102669857224068770595717186097,
    "created": "2017-11-11T16:56:21.905126+10:00",
    "devaddr": 100663297,
    "devclass": "a",
    "deveui": 1084820009240297987,
    "enabled": true,
    "latitude": null,
    "longitude": null,
    "name": "ota_device",
    "nwkskey": 36098233829964436111170732764803731455,
    "otaa": true,
    "snr_average": 10.7666666666667,
    "tx_datr": "SF7BW125",
    "updated": "2017-11-11T16:56:21.905161+10:00"
}

Error Responses:

Code: 401 UNAUTHORIZED

{
    "message": "The server could not verify that you are authorized to access the URL requested.  You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."
}

Code: 404 NOT FOUND

{
    "message": {
        "error": "Device 0026.8a61.68f5.c523 doesn't exist"
    }
}

Sample Call

  $.ajax({
    url: "/device/1084820009240297987",
    dataType: "json",
    type : "GET",
    success : function(r) {
      console.log(r);
    }
  });
Clone this wiki locally