# Getting a JSON message from an external server into Node-Red

**URL:** <https://discourse.nodered.org/t/getting-a-json-message-from-an-external-server-into-node-red/80217>\
**Category:** General\
**Tags:** node-red-contrib-alexa-remote2-applestrudel\
**Created:** [1 August 2023 12:29 UTC](https://discourse.nodered.org/t/getting-a-json-message-from-an-external-server-into-node-red/80217 "2023-08-01T12:29:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haegar33](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haegar33/32/38805_2.png) [@haegar33](https://discourse.nodered.org/u/haegar33)\
**Post date:** [1 August 2023 12:29 UTC](https://discourse.nodered.org/t/getting-a-json-message-from-an-external-server-into-node-red/80217/1 "2023-08-01T12:29:31Z")

</div>

I am playing with a new approach to get Alexa devices interacting with my NR setup. Instead of using the _alexa-remote2-applestrudel_ module I write my own Alexa skill and attach it to my endpoint. I managed to accomplish this using my Synology NAS which has a public domain **user\_xx/dscloud.me** using a _LetsEncrypt_ certificate which is accepted by Alexa.  
For now my endpoint is a simple php script at:

```auto
https://user_xx.dscloud.me/alexa/simple.php

```

where I can receive JSON formatted messages triggered by my skill. However I dont want to do the processing with PHP but rather "channel" the Alexa message to my NR rapspberry installation, process the data and send back a proper Alexa response.

My question is not so much on the Alexa processing but I wonder how this "channeling" might work? Of course the NAS is the only LAN device with public access, my Raspberry is only reachable with a local 192.168.178.xx adress

Is this feasible? Using the http-request, http-in modules somehow?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [1 August 2023 15:24 UTC](https://discourse.nodered.org/t/getting-a-json-message-from-an-external-server-into-node-red/80217/2 "2023-08-01T15:24:47Z")

</div>

A lot of people use MQTT with NR IOT flows.

You could have your NAS publish the incoming messages to an MQTT server on the Pi, and subscribe to topics to receive messages back from NR to forward back to amazon.  
PHP then only needs minimal functionality.

---

<div class="post-metadata">

**Author:** ![haegar33](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haegar33/32/38805_2.png) [@haegar33](https://discourse.nodered.org/u/haegar33)\
**Post date:** [1 August 2023 21:10 UTC](https://discourse.nodered.org/t/getting-a-json-message-from-an-external-server-into-node-red/80217/3 "2023-08-01T21:10:32Z")

</div>

Actually, I had the same idea 1 hour before reading your post 😉  
Working with MQTT is straightforward in NR. I already managed to send MQTT message from the PHP script. 😀

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 September 2023 21:10 UTC](https://discourse.nodered.org/t/getting-a-json-message-from-an-external-server-into-node-red/80217/4 "2023-09-30T21:10:54Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
