cbrdata.com
  • cbrdata API
Powered by GitBook
On this page
  • Public Access Endpoints
  • Sensor Data V1
  • Node/Device Information
  • Sensor Data V2

Was this helpful?

cbrdata API

Documentation for the cbrdata API developed at The University of Canberra

Last updated 6 years ago

Was this helpful?

Public Access Endpoints

The endpoints below are intended to provide data to clients and external developers. Please sign up via the Arboretum or Queanbeyan as a Developer to generate API keys. Please use the subdomain qprcapi instead of api to access data from the Queanbeyan-Palerang City Council Project. e.g. qprcapi.cbrdata.com

API V1

Public endpoints for soil moisture data management.

Sensor Data V1

GET https://api.cbrdata.com/api/nodedata/:from/:to

This endpoint allows authorised users to request soil moisture data records from available soil moisture nodes. Returns a JSON object.

Path Parameters

Name
Type
Description

from

integer

The lower date threshold as a Unix timestamp. Can be overridden by the days query parameter.

to

integer

The upper date threshold as a Unix timestamp.

Query Parameters

Name
Type
Description

nodeNum

string

Node/device number (as a string). A human-readable number assigned to a node. The number is usually determined based the order of deployment. Can be customized via the Management Portal.

forestId

string

Forest number (as a three character string) which uniquely identifies a forest/location. E.g. 008, 100 etc. Overrides the forest parameter. For the National Arboretum Canberra, the forest number is that of the actual forest based on the data provided by the arboretum. For other clients, an arbitrary number is used to specify a location.

days

number

Specifies the number of days from the upper date threshold to return the data for. Overrides the lower date threshold if required. E.g days=3 will return data for the last three days if the upper date threshold is the current time. Note: A hard limit of 6000 records is in place for external requests.

limit

integer

Number used to specify or limit the number of requests/records returned. This parameter is overridden if the days parameter is present in the request.

org

string

The full name of client/organisation who owns or produces the requested data. E.g National Arboretum Canberra or Queanbeyan City Council.

token

string

API key used to authorize the request. Can be generated from the dashboard under the API Settings tab within the Account menu. Please Note that API keys cannot be generated unless your account has been approved by an admin and once generated, will have API permissions based on your account's approved access level i.e. Developer, Client, Admin etc. For general API functionalities Developer level is sufficient. Network management functions require elevated accounts. Changes to your account's access level can be requested from the dashboard under the Account Setting tab within the Account menu.

userId

string

(Dashboard USE ONLY) The requesting user's unique id generated during account registration to authorize the request. The id is used to reference the requesting user and their API permission. While not enforced, this parameter is reserved for dashboard use only. Users do not have access to their unique user id. Use the token parameter general requests.

forest

string

The full identifier for the forest/location, where the sensor node is located such as 'F008 Japanese Flowering Dogwood' or 'L010 Queen Elizabeth II Park' or 'Water Module (Queel El II Park)' . The full forest identifier for soil nodes consist of values from the following the metadata fields in the given order: forsest_num+" "+" "+forest_name Can be used instead of the node parameter. Can be customized via the Management Portal Keep in mind that this value is subject to modification by the client or administrator via the network management portal. If it is modified, it will be displayed as such in the data dashboard. It is recommended that you update your existing requests accordingly.

node

string

The unique node/device identifier. Used to query data collected by a particular sensor node irrespective of its previous or current location. Overrides all other identifying parameters i.e. forest, forestId and nodeNum .


{
    "count": 2,
    "meta": {
        "some_unique_id": {
            "lat_lng": [-24.1231,-123.1231],
            "node_num": "10",
            "vwc30_low": 10.3,
            "vwc30_mid": 12.72,
            "vwc60_low": 16.5,
            "vwc60_mid": 17.63,
            "forest_num": "023",
            "vwc30_high": 14.7,
            "vwc60_high": 31.1,
            "forest_name": "Parana Pine",
            "active_since": 1531058469,
            "forest_boundry": "149.0739895728598,-35.28893879348822,0 149.0738328578673,-35.28884416443776,0 149.0736053770746,-35.28870680430924,0 149.0726928059028,-35.2897227739313,0 149.0743438571936,-35.29071972141189,0 149.0746213189179,-35.29088725507324,0 149.0748392088915,-35.29062109274278,0 149.0748904042846,-35.29056743748038,0 149.0749700598445,-35.29049332968688,0 149.0750717764896,-35.29041198285805,0 149.0754312056607,-35.29024035572771,0 149.0755987350303,-35.29020417880017,0 149.0757612472829,-35.29017462477777,0 149.0759911252785,-35.29014735147081,0 149.0739895728598,-35.28893879348822,0"
        }
    },
    "data": {
        "some_unique_id": [
            {
                "full_node_id": "some_unique_id",
                "temperature": 26.9,
                "vwc30": 0.136,
                "vwc60": 0.218,
                "battery_voltage": 1.01,
                "upload_timestamp": 1547465303,
                "count": "4"
            }, 
            {
                "full_node_id": "some_unique_id",
                "temperature": 27.1,
                "vwc30": 0.136,
                "vwc60": 0.219,
                "battery_voltage": 1.01,
                "upload_timestamp": 1547463502,
                "count": "4"
            }
        ]
    }
}
{message:"Bad Request",  status:400}
{message:"Unauthorised",  status:400}
{message:"Forbidden",  status:403}
Not Found
{message:"Internal Server Error",  status:500}

Node/Device Information

GET https://api.cbrdata.com/api/nodeinfo

Retrieves all available metadata on registered nodes/device. Data is grouped by the node's unique identifier. Retrieved metadata can be utilized to make requests on /nodedata Returns a JSON object.

Query Parameters

Name
Type
Description

userId

string

(Dashboard USE ONLY) The requesting user's unique id.

token

string

API key used to authorize the request.

org

string

The full name of client/organisation who owns or produces the requested data. E.g National Arboretum Canberra or Queanbeyan City Council.

{
    "some_node_1": {
        "lat_lng": [-12.4434, 12312.11],
        "node_num": 8,
        "vwc30_low": 23.3,
        "vwc30_mid": 24.36,
        "vwc60_low": 28.6,
        "vwc60_mid": 30.22,
        "forest_num": "008",
        "vwc30_high": 25.3,
        "vwc60_high": 31.5,
        "forest_name": "Japanese Flowering Dogwood",
        "active_since": 1531058469,
        "forest_boundry": "149.0796113799227,-35.2871284150761,0 149.0795475112163,-35.28708983324432,0 149.0794324700909,-35.28702033913545,0 149.0785198261107,-35.28803653708137,0 149.0791913745544,-35.28844199868593,0 149.079206347198,-35.28845103881466,0 149.0793754680926,-35.28836306143108,0 149.0795047261577,-35.28829605000612,0 149.0797281012334,-35.28817594458858,0 149.07990002243,-35.28808156382936,0 149.0800539797064,-35.28797152928961,0 149.0802079365661,-35.28786149446437,0 149.0802723414693,-35.28780969879308,0 149.0803196081066,-35.28777168619416,0 149.0804312794008,-35.28768187763872,0 149.0804512211684,-35.28765216490685,0 149.0804626491778,-35.28764260453301,0 149.0803378520016,-35.28756725743101,0 149.0796113799227,-35.2871284150761,"
    },
    "some_node_2": {
        "lat_lng": [-13.4434, 123112.11],
        "node_num": "10",
        "vwc30_low": 10.3,
        "vwc30_mid": 12.72,
        "vwc60_low": 16.5,
        "vwc60_mid": 17.63,
        "forest_num": "023",
        "vwc30_high": 14.7,
        "vwc60_high": 31.1,
        "forest_name": "Parana Pine",
        "active_since": 1531058469,
        "forest_boundry": "149.0739895728598,-35.28893879348822,0 149.0738328578673,-35.28884416443776,0 149.0736053770746,-35.28870680430924,0 149.0726928059028,-35.2897227739313,0 149.0743438571936,-35.29071972141189,0 149.0746213189179,-35.29088725507324,0 149.0748392088915,-35.29062109274278,0 149.0748904042846,-35.29056743748038,0 149.0749700598445,-35.29049332968688,0 149.0750717764896,-35.29041198285805,0 149.0754312056607,-35.29024035572771,0 149.0755987350303,-35.29020417880017,0 149.0757612472829,-35.29017462477777,0 149.0759911252785,-35.29014735147081,0 149.0739895728598,-35.28893879348822,0"
    }
}
{message:"Unauthorised",  status:401}
{message:"Internal Server Error",  status:500}

API V2

API endpoints for environmental data management.

Sensor Data V2

GET https://qprcapi.cbrdata.com/api/v2/nodedata/:from/:to

This endpoint allows authorised users to request environmental data records from available environmental monitoring nodes. Please refer to Sensor Data V1 for more details on query parameters if required. Returns a JSON object.

Path Parameters

Name
Type
Description

from

integer

The lower date threshold as Unix timestamp.

to

integer

The upper date threshold as Unix timestamp.

Query Parameters

Name
Type
Description

days

number

Specified the number of data from the upper threshold to return the data for. Overrides the lower data threshold if required. E.g. days=3 will return data from the last three days if the upper threshold is the current time. Note: A hard limit of 6000 record is in place for external records.

limit

integer

Number used to specify or limit the number of requests/records returned. THis parameter is overridden if the days parameter is present in the request.

userId

string

(Dashboard USE ONLY) The requesting user's unique id.

token

string

API key used to authorize the request.

node

string

The unique node/device identifier. Used to query the data collected by a particular sensor node.

{
    "meta": {
        "node_id": "some_unique_id_1"
    },
    "data": [{
        "noise": 64.52,
        "tc": 31.54,
        "hum": 38.1,
        "pres": 94177.66,
        "co2": 344.517,
        "bat": 52,
        "upload_timestamp": 1545268386
    },{
        "noise": 56.5,
        "tc": 22.42,
        "hum": 48.8,
        "pres": 94231.7,
        "co2": 602.077,
        "bat": null,
        "upload_timestamp": 1545005381
    }, {
        "noise": 0,
        "tc": 22.43,
        "hum": 48.9,
        "pres": 94240.89,
        "co2": 641.537,
        "bat": null,
        "upload_timestamp": 1545005225
    }],
    "count": 3
}
{message:"Bad Request",  status:400}
{message:"Unauthorised",  status:401}
{message:"Internal Server Error",  status:500}

dashboard
dashboard