• 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

    Can I get data back to my device using HTTP?

    Scheduled Pinned Locked Moved Mango Automation general Discussion
    14 Posts 4 Posters 3.7k Views 3 Watching
    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.
    • V Offline
      v8dave
      last edited by

      Excellent Jared. That worked. I tried it in the browser and I could get the data back from Mango. Now I can code on the remote device to poll this data.

      I have a custom built data logger running NETMF and this will poll the data over the GPRS connection.

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

        Great. The only issue you may have is authentication, the current Mango authentication is all session cookie based. You will have to make sure your HTTP client can handle cookies. You can find the REST end points for logging in in the Swagger documentation, change your env.properties so that swagger.enabled=true and navigate to /swagger/index.html

        Mango 2.8 will support token based authentication for the REST API.

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • V Offline
          v8dave
          last edited by

          Ah, that might be a bit of a problem. There is no cookie capability as this does not have a proper browser.

          I tried it on a browser that was not logged in and sure enough, I got an access denied message.

          Is it possible to use some form of API key or other method to do this?

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

            Nope, at the moment session cookies are the only supported authentication mechanism. 2.8 will have token authentication.

            I'm not familiar with NETMF but even if it doesn't support cookies you should be able to manually read the Set-Cookie header when you login and send it back in the Cookie header with each request.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • V Offline
              v8dave
              last edited by

              OK. I'll check out how to do this.

              1 Reply Last reply Reply Quote 0
              • JoelHaggarJ Offline
                JoelHaggar
                last edited by

                Here is a link to some documentation about how authentication works which should be helpful:
                https://help.infiniteautomation.com/support/solutions/articles/14000023292-mango-rest-api-authentication

                1 Reply Last reply Reply Quote 0
                • Woody BeverleyW Offline
                  Woody Beverley
                  last edited by

                  @v8dave
                  Does your device support Python by chance or some other scripting language?

                  -WoodyB

                  1 Reply Last reply Reply Quote 0
                  • V Offline
                    v8dave
                    last edited by

                    Hi Woody, the unit is programmed with C# using .NET Micro Framework running a custom board with the GHI Electronics G400D module.

                    1 Reply Last reply Reply Quote 0
                    • Woody BeverleyW Offline
                      Woody Beverley
                      last edited by

                      Hmmm, well the C# path may lead you somewhere. Then again, it could be down a rabbit hole I suppose.

                      -WoodyB

                      1 Reply Last reply Reply Quote 0
                      • V Offline
                        v8dave
                        last edited by

                        I should be able to do this one I figure out how to login from the device using TCP/IP. I have a full implementation of the TCP/IP stack on this device. I can then extract the cookie and use this to send back with the request.

                        It's just another level of coding I need to add. At present I send HTTP without doing any logging in.

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