• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Mango REST API and Watch Lists

    User help
    mangoapi watchlist datapoint
    3
    5
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      silvia
      last edited by silvia

      Hi all,

      I can successfully create Watch Lists through the Mango REST API using Node.js and Javascript, but how can I assign data points to them?

      I have tried retrieving an existing watchlist through GET /v1/watch-lists, but it doesn't have any information about the data points in it. I can get all the data points throught GET /v1/watch-lists/{xid}/data-points, but I still don't get how to create a watchlist and associate data points to it.

      Any ideas? Is it a two-step process (creating the watchlist first with POST and updating it later with PUT?)?

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ
        Jared Wiltshire
        last edited by

        It depends on the type of Watchlist. There are 3 types, static, point query and point hierarchy.

        Static will have an array of points (points) set on it (Not actually the full points, you can get those from the URL you posted), point query has a query property which is just the RQL query for the data points end-point, and the point hierarchy has an array of folder ids (folderIds) from which it gets its points.

        So no, its not a two step process. I'd suggest opening the Chrome debugger and watching the requests to /rest/v1/watch-lists when saving a watch list.

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          Hi silvia,

          I'm surprised you didn't see the information about how the points are selected. Here are three models for the three watchlist types, static, query, and hierarchy,

          Static:

          {
            "xid": "WL_Static",
            "name": "Test",
            "modelType": "WATCH_LIST_SUMMARY",
            "validationMessages": [],
            "points": [
              {
                "xid": "DP_NT__2_22_1st_Flr_Auditorium_N_TID",
                "name": "tid",
                "deviceName": "2-22 1st Flr Auditorium N",
                "pointFolderId": 31,
                "readPermission": "",
                "setPermission": ""
              },
              {
                "xid": "DP_NT__2_22_1st_Flr_Auditorium_N_FanStatus",
                "name": "fan_status",
                "deviceName": "2-22 1st Flr Auditorium N",
                "pointFolderId": 31,
                "readPermission": "",
                "setPermission": ""
              }
            ],
            "type": "static",
            "query": null,
            "params": null,
            "readPermission": null,
            "username": "admin",
            "editPermission": null,
            "folderIds": null,
            "data": null,
            "id": 1
          }
          

          Notice the data point summaries. But, you can import these with only an "xid" in the point object and it'll import fine.

          Query:

          {
            "xid": "WL_Query",
            "name": "TempForecast",
            "modelType": "WATCH_LIST_SUMMARY",
            "validationMessages": [],
            "points": [],
            "type": "query",
            "query": "like(name,Temperature%20Forecast)&sort(deviceName,name)&limit(200)",
            "params": null,
            "readPermission": "user",
            "username": "admin",
            "editPermission": "edit-watchlists",
            "folderIds": null,
            "data": {
              "paramValues": {}
            },
            "id": 129
          }
          

          Notice the "query" member.

          Hierarchy:

          {
            "xid": "WL_Hierarchy",
            "name": "PH",
            "modelType": "WATCH_LIST_SUMMARY",
            "validationMessages": [],
            "points": [],
            "type": "hierarchy",
            "query": null,
            "params": null,
            "readPermission": "user",
            "username": "admin",
            "editPermission": "edit-watchlists",
            "folderIds": [
              20,
              45
            ],
            "data": null,
            "id": 161
          }
          

          Notice the "folderIds" member

          1 Reply Last reply Reply Quote 0
          • S
            silvia
            last edited by

            Thanks guys, I'll try it out today or next week and see how it goes! :)

            1 Reply Last reply Reply Quote 0
            • S
              silvia
              last edited by

              It goes perfectly, thanks again!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post