• 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

    query realtime data by passing multiple XID

    How-To
    2
    4
    2.8k
    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.
    • D
      djmolloyjr22
      last edited by

      Hello,

      Using the new beta 1.6, trying to use REST/SWAGGER to query the latest real-time read data for multiple XID. For example, the query would be something like: ?XID0=DP_622107&XID1=DP_621502&XID2=DP_622361 and the return would be a set of the 3 values.

      Thanks,

      Dan

      1 Reply Last reply Reply Quote 0
      • terrypackerT
        terrypacker
        last edited by

        Dan,

        We don't currently support IN style queries in RQL yet. We are planning to add this but in the meantime you could use a LIKE query. Unfortunately I have found a bug in the LIKE query for the realtime endpoint so you will need to upgrade the 2.6 core when we push out the fix.

        When the fix is ready you can use a query like this:

        /rest/v1/realtime.json?like(xid,DP_62.*)
        

        In the LIKE query you can use the dot star notation for a wildcard. For example

        test.* --> Matches test_1 or testAgain
        
        .* --> Matches everything
        
        .*test --> Matches 1_test or againTest
        

        We use Regular expressions for string matches in RQL so any of the Java regex patterns and classes are valid so long as you escape them properly in the URL.

        But this will likely return more than your desired results if other XIDs match that pattern.

        I would suggest either placing all the points under some path in the point hierarchy and then using this query:

        /rest/v1/realtime.json?like(path,my_path_to_points)
        

        Or renaming the XIDs to something more meaningful for this purpose:

        DP_groupA_member0
        DP_groupB_member1
        

        Or using the point name in the same manner.

        Thanks,
        Terry

        D 1 Reply Last reply Reply Quote 0
        • D
          djmolloyjr22 @terrypacker
          last edited by

          @terrypacker

          We had a little trouble with the path until we realized we needed to escape the slashes. For example: /rest/v1/realtime.json?like(path,/datacenter/5/room/4) would need to be sent as: /rest/v1/realtime.json?like(path,%2fdatacenter%2f5%2froom%2f4%2f)

          1 Reply Last reply Reply Quote 0
          • terrypackerT
            terrypacker
            last edited by

            One quick note:

            In the latest nightly build of 2.6.0 we are removing the ability to add the .json to the end of the URLS for the REST api. This was done because we found we could not easily interpret dots in other areas of the URL. So for example:

            /rest/v1/users/admin.json

            must now be:

            /ret/v1/users/admin

            This better allows us to do things like:
            /rest/v1/users/firstname.lastname

            The other feature this effects is the ability to define the content type using a file extension on the URL. So for example previously one could request a csv file:

            /rest/v1/data-points/data-source/DS_XID.csv

            Or a JSON file:

            /rest/v1/data-points/data-source/DS_XID.json

            One must now use:
            /rest/v1/data-points/data-source/DS_XID?format=csv
            OR
            /rest/v1/data-points/data-source/DS_XID?format=son
            OR
            Set the accept header in the request to the desired file type (CSV or JSON support only for now)

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