Retrieving Site Information

Presentation

Description Authorization Method Request
This query retrieves information from the site. Public GET /v1/sites/:siteID

URL parameters

Parameter Type Description
:siteID String Unique site identifier.

URL parameters

Required

None

Optional

None

Successful message

Sample request

            curl -i -X GET 'https://api.openrj.eu/v1/sites/test_site'

            HTTP/1.1 200 OK

            {
              "sites": [
                {
                  "description": "Ce site est un site de test et sera bientôt supprimé.",
                  "extID": "test_site",
                  "label": "Site de test",
                  "location": "64",
                  "photo": "/images/community/business-pole.jpg",
                  "public": true,
                  "id": "53bc1a1a2216051951867357",
                  "links": {
                    "variables": [
                      "53bc1a1faa0f163d46c2491c",
                      "53bc1a1faa0f163d46c2491d",
                      "53bc1a1faa0f163d46c2491e",
                      "53bc1a1faa0f163d46c2491f",
                      "53bc1a1faa0f163d46c24920",
                      "53bc1a1faa0f163d46c24921",
                      "53bc1a1faa0f163d46c24922",
                      "53bc1a1faa0f163d46c24923",
                      "53bc1a1faa0f163d46c24924",
                      "53bc1a1faa0f163d46c24925",
                      "53bc1a1faa0f163d46c24926",
                      "53bc1a1faa0f163d46c24927"
                    ],
                    "variablesExtID": [
                      "energy_aircond_3",
                      "energy_aircond_1",
                      "energy_aircond_2",
                      "energy_plugs_2",
                      "energy_plugs_3",
                      "energy_lights_3",
                      "energy_plugs_1",
                      "energy_lights_1",
                      "energy_lights_2",
                      "test1",
                      "test2",
                      "test3"
                    ]
                  }
                }
              ]
            }
            

Details

Parameter Type Description
Sites Array List of sites of the OpeNRJ platform.
sites[i].id String Site identifier.
sites[i].extID String Site identifier.
sites[i].label String Name of the site.
sites[i].photo String Photo of the site.
sites[i].description String Description of site.
sites[i].location String Location of the site.
sites[i].public Boolean Visibility index of the site. If public is true, then anyone can retrieve the data from that site.
sites[i].links Object Link to child nodes.

Error message "Site not found"

Sample request

            curl -i -X GET 'https://api.openrj.eu/v1/sites/test_site2'

            404 Not Found

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

Causes

This site does not exist.