• 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

    HTTP Retriever and JSON data

    Mango Automation general Discussion
    json httpretriever
    2
    4
    1.7k
    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.
    • C
      C00L3R
      last edited by C00L3R

      Hello,

      Im trying to read data from JSON service.

      JSON data addres is: http://192.168.1.250/iolinkmaster/port[4]/iolinkdevice/pdin/getdata

      Data is: {"cid":-1,"data":{"value":"0079FD03"},"code":200}

      I used HTTP Retriever, with that URL. Received value is in hexadecimal format, Im interestet in first 4 characters.

      Using https://regex-testdrive.com/en/dotest I made a RegEx: .*"value":"([0-9A-Z]+)FD03"},"code":200}

      0_1540449763789_2c3eb8c5-88ff-404e-9773-8cbd91c6af4d-image.png

      Next I made a data point with that RexEx. But when I click on "Test value parameters" button I get error: java.lang.IllegalArgumentException: Illegal character in path at index 38: http://192.168.1.250/iolinkmaster/port[4]/iolinkdevice/pdin/getdata

      Also it doesn't matter if I use RegEx on data point - I still get that error trying to test value. .

      And now I need help how to resolve this error.
      Also my next question is how to convert hexadecimal data value to decimal.

      Regards.

      1 Reply Last reply Reply Quote 0
      • CraigWebC
        CraigWeb
        last edited by CraigWeb

        Hi CooL3R

        Looks like your URL has illegal characters. try replacing [ & ] with %5B and %5D respectively. You will probably need to make a meta point to convert the point to decimal.

        C 1 Reply Last reply Reply Quote 0
        • C
          C00L3R @CraigWeb
          last edited by

          @craigweb said in HTTP Retriever and JSON data:

          Looks like your URL has illegal characters. try replacing [ & ] with %5B and %5D respectively.

          Thanks, that helped.

          1 Reply Last reply Reply Quote 0
          • CraigWebC
            CraigWeb
            last edited by

            No problem. to convert it to decimal you could use alphanumeric meta point and in your script do the following.

            0_1540461554887_Screen Shot 2018-10-25 at 11.58.20.png

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