Retrieve the list of metadata from a variable in a site

Presentation

Description Authorization Method Request
This query makes it possible to retrieve the list of metadata of a variable of a site registered on the OpeNRJ platform. Public GET /v1/sites/:siteID/variables/:variableID

URL parameters

Parameter Type Description
:siteID String Unique site identifier.
:variableID String Unique identifier of the variable.

URL parameters

Required

None

Optional

None

Successful message

Sample request

            curl -i -X GET 'https://api.openrj.eu/v1/sites/test_site/variables/energy_aircond_3'
            
            HTTP/1.1 200 OK

            {
              "variables": [
                {
                  "extID": "energy_aircond_3",
                  "label": "aircond_3",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c2491c"
                }
              ]
            }
            

Details

Value of the type returned by the variable:
Parameter Type Description
variables Array List of site variables.
variables[i].id String Identifier of the variable.
variables[i].extID String Identifier of the variable.
variables[i].label String Variable name.
variables[i].type String The type of value returned by the variable.
variables[i].valueType String
  • N: digital
  • L: logical (true or false)
  • T: text (string)
variables[i].unit String Unit of the value returned by the variable.
variables[i].public String Visibility of the variable. If public is true, anyone can see the values collected by the variable.
(optional) variables[i].lowerBound Number Lower limit inclusive of allowable values.
(optional) variables[i].upperBound Number Upper limit inclusive of allowable values.
(optional) variables[i].deltaMin Number Minimum differential inclusive with previous value.
(optional) variables[i].deltaMax Number Maximum differential inclusive with previous value.

Error message "Site not found"

Sample request

            curl -i -X GET 'https:/api.openrj.eu/v1/sites/test_site2/variables/energy_aircond_3'
            
            HTTP/1.1 404 Not Found

            {
              "error": "Site not found."
            }
            

Causes

This site does not exist.

Error message & quot; Variable not found & quot;

Sample request

            curl -i -X GET 'https://api.openrj.eu/v1/sites/test_site/variables/energy_aircond_31'
            
            HTTP/1.1 404 Not Found

            {
              "error": "Variable not found."
            }
            

Causes

This variable does not exist.