Is it possible to access devices from external app using REST API #635
-
Hello, I'm curious if there is a way to access the devices using a REST API? I've looked through the documentation, but I couldn't find any information on it. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
We currently don't support running a web server from the device, so you would not be able to access them via REST. You can do the other way around where the device opens a websocket to a known webserver and start communication with the server. |
Beta Was this translation helpful? Give feedback.
-
I'm currently utilizing virtual devices. Although I'm not well-versed in TypeScript (TS), I attempted to include the Express package in order to expose sensor data through an API. Unfortunately, I encountered package errors in the process. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, DeviceScript is rather different than node.js and express (or the http/https package won't work in that environment). If you need to do REST request from the device, you can use fetch |
Beta Was this translation helpful? Give feedback.
Unfortunately, DeviceScript is rather different than node.js and express (or the http/https package won't work in that environment). If you need to do REST request from the device, you can use fetch