Elements_V2

Get elements and id .

You can enter a group id or devices type.

/v2/elements?gid=XXX&type=XXX

Arguments

  • gid: (Optional) Groups ID.

  • type: (Optional) Devices type. (Valid types: tcp_meter, gsm_meter, inverter, sensor, string, tracker)

Response

JSON object with the result. May return the following errors:

  • 404 Not found : No elements found or don't have rights to get data
  • 400 Wrong type or id: The id format is incorrect
  • 204 No data found: The data entered have not produced any results

Example

Get all elements

GET /v2/elements HTTP/1.1
Host: apiexternal.mvscada.com
MV-API-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Content-Type: application/json

Response

{
    "Group 1": {
        "groups_name": "Group 1",
        "groups_id": 1,
        "facilities": {
            "Agrupación Group 1": {
                "insts_name": "Agrupación Group 1",
                "insts_id": 1,
                "devices": {
                    "tcp_meter": {
                        "123": "Group 1 - Secundario"
                    }
                }
            },
            "Inst Group 1": {
                "insts_name": "Inst Group 1",
                "insts_id": 2,
                "devices": {
                    "tcp_meter": {
                        "124": "Group 1 - Principal"
                    },
                    "inverter": {
                        "217": "Inst Group 1 - inversor 1",
                        "218": "Inst Group 1 - inversor 2",
                        "219": "Inst Group 1 - inversor 3",
                        "220": "Inst Group 1 - inversor 4",
                        "221": "Inst Group 1 - inversor 5",
                        "222": "Inst Group 1 - inversor 6",
                        "223": "Inst Group 1 - inversor 7",
                        "224": "Inst Group 1 - inversor 8",
                        "225": "Inst Group 1 - inversor 9",
                        "226": "Inst Group 1 - inversor 10",
                        "227": "Inst Group 1 - inversor 11",
                        "228": "Inst Group 1 - inversor 12",
                        "229": "Inst Group 1 - inversor 13",
                        "230": "Inst Group 1 - inversor 14"
                    }
                }
            }
        }
    },
}

Other examples

Get all elements of specific group
    /v2/elements/?gid=123

Get all elements of tcp_meter type
    /v2/elements/?type=tcp_meter

Get all elements of tcp_meter type of specific group
    /v2/elements/?type=tcp_meter&gid=123