Using REST API with Raspberry Pi

Hey all, I’m running Yunohost on a Raspberry Pi. I want to be able to make REST API calls to my device. I’d like to be able to send it commands from my phone to trigger scripts and such.

Do I need to:

  • Install some kind of service on the Raspberry Pi itself, and if so, how do I configure that with the domains I have pointing to it? Or,
  • Is there some app from the catalog I can install that will allow me to do this?

I’m specifically interested in being able to send a command as arguments in the call and then have the Raspberry Pi execute a sh file or command as a response depending on the variables received.

I suppose this is more of a Raspberry Pi question than a Yunohost question, but the only way I know how to reach my Raspberry Pi from the outside internet is through the domains I’ve got pointing to my device, which are for the Yunohost.

You’ll probably want to install the “redirect” app such that it configures a reverse proxy on nginx and adds the proper ssowat configuration, but apart from that it’s all up to you what your REST API does and how it does it exactly …

1 Like

Can you direct me to documentation that indicates how to set that up properly? I’m looking at the app install page and I’m not clear on how I’d do the set up to listen for API calls.