We have a requirement where the users have to authenticate via a web service before they can start using a machine. The Web Service is fairly simplistic which takes the device id and authentication key as the parameters and returns back either “true” or “false” indicating whether the user has access to machine or not.
Now my question is
- Is there a way to invoke a web service (REST API POST) from the device directly. Do you have a sample code for the same
- Just in case # 1 is not possible, we could potentially use HologramCloud.sendMessage and then configure a Data Route to use Advanced Web Hook Builder to post the message – however I cannot see a way to return back the value “true” or “false” from our API to the device.
- I am guessing the above could be achieved by either sending an SMS to the device OR sending a message from our web service to a device specific web-hook and within our HologramDash, we could listen to messages using HologramCloud.listen() to subscribe to events send from the cloud. Is there a best practice approach from your perspective considering that the user journey for authentication has to almost work instantaneously.
- Is there any other mechanism for getting access to the web service response data.