# Trigger from / with url

**URL:** <https://discourse.nodered.org/t/trigger-from-with-url/11060>\
**Category:** General\
**Created:** [13 May 2019 09:25 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060 "2019-05-13T09:25:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [13 May 2019 09:25 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/1 "2019-05-13T09:25:50Z")

</div>

Hi!

Can i trigger a node-red flow with just calling an url?

Just like 127.0.0.1:1880/some\_url  
and the start a flow

Thanks!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 May 2019 09:30 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/2 "2019-05-13T09:30:06Z")

</div>

Yes - the HTTP In nodes do just that.

[https://cookbook.nodered.org/http/create-an-http-endpoint](https://cookbook.nodered.org/http/create-an-http-endpoint)

---

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [13 May 2019 11:28 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/3 "2019-05-13T11:28:44Z")

</div>

Cool it works, thanks to the example 😉

---

<div class="post-metadata">

**Author:** ![europer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europer/32/28437_2.png) [@europer](https://discourse.nodered.org/u/europer)\
**Post date:** [11 September 2020 12:54 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/4 "2020-09-11T12:54:14Z")

</div>

Thanks for the info but need a bit help.  
I have some cam's, blue iris (cam program) and deepstack (AI) analysing the pics if persons or not to reduce false trigging almost to zero. The AI program trigger with http commands to blue iris to record a sequence or not. The issue is that the AI program don't send mqtt but I can send in the AI program multi http commands. I want to send a simple http to my Node-RED to say cam number X is triggered so that Node-RED can prossesing things in my house upon this information. I use user and password in my Node-RED.

Could you give me an bold example since I don't figer out in the cookbook how to do it.

1. URL like: [http://192.168.0.88:1880/](http://192.168.0.88:1880/)"and now I don't know what to do" in a browser or in the AI program (btw 192.168.0.88 is the IP of my Node-RED server)
2. And how does it look in the Node-RED?

Thanks  
Per

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 September 2020 07:47 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/5 "2020-09-12T07:47:15Z")

</div>

I am not that experienced in this area but it isn't clear exactly where your difficulty is. Is it that you don't know how to setup an http endpoint in node-red to receive the http message from the AI program or you don't know how to invoke that from the AI program?

---

<div class="post-metadata">

**Author:** ![europer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europer/32/28437_2.png) [@europer](https://discourse.nodered.org/u/europer)\
**Post date:** [12 September 2020 09:11 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/6 "2020-09-12T09:11:53Z")

</div>

Hi,  
Thanks for responding 😊  
To make it really simple:  
I want to send over http as example over my browser just some simple information, let's say  
CAM01  
ON  
As I said in a http line to my Node-RED like:  
[Http://myNodeRed:1880/](Http://myNodeRed:1880/)"and here the 2 information above"  
How will this http line look like?

Then how to do a node or 2 look like in node red to get this information?

Just to get the info CAM01 and ON

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 September 2020 10:22 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/7 "2020-09-12T10:22:48Z")

</div>

When you enter an address in the browser you are doing an http GET (which is intended to just get information from a website). You can specify what information you want by adding parameters. So in your case you might use something like `http://192.168.0.88:1880/myapi?cam01=on`. [This example in the cookbook](https://cookbook.nodered.org/http/handle-query-parameters) shows you how to do this. However you shouldn't use a GET for telling the server to do something, you should use a POST for this. Part of the reason is that if you are looking at a page in the browser and you refresh the page it will issue the request again, so node-red would receive the request again and repeat whatever action you asked for. So to tell the server to do something you should always use an http POST where the instructions on what to do (cam01=on in this case) is sent in the request, not in the url. That is what happens with a form on a website for example, when you click the submit button it sends a POST to the server containing the information. There are three examples on how to do that in the http endpoints section of the cookbook at [https://cookbook.nodered.org/#http-endpoints](https://cookbook.nodered.org/#http-endpoints). I suggest you have a play with those examples and see how they work.

---

<div class="post-metadata">

**Author:** ![europer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europer/32/28437_2.png) [@europer](https://discourse.nodered.org/u/europer)\
**Post date:** [12 September 2020 11:52 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/8 "2020-09-12T11:52:45Z")

</div>

Thanks 😊👍 I see the point with put and will play around the example in the cookbook

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 September 2020 12:23 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/9 "2020-09-12T12:23:43Z")

</div>

Are you able to generate POST requests in your AI software?

---

<div class="post-metadata">

**Author:** ![europer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europer/32/28437_2.png) [@europer](https://discourse.nodered.org/u/europer)\
**Post date:** [12 September 2020 13:30 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/10 "2020-09-12T13:30:32Z")

</div>

In the AI what sends a URL info to the cam web server looks like this:

[http://192.168.0.200:81/admin?camera=[CAM01]&trigger&user={admin}&pw={1234}](http://192.168.0.200:81/admin?camera=%5BCAM01%5D&trigger&user=%7Badmin%7D&pw=%7B1234%7D)

(Original copy paste of the URL just the password is different 😉)

Where 192.168.0.200:81 is the cam Web server

No I can't put something ahead of the http, just [http://something](http://something). I can have multi [http://something](http://something) with "," between them but no PU T http://

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 September 2020 14:03 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/11 "2020-09-12T14:03:47Z")

</div>

You don't put POST before the http, it would have to know that you want to use POST. If you can't then you will just have to use get.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 September 2020 14:41 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/12 "2020-09-12T14:41:07Z")

</div>

I googled for deepstack mqtt and found a number of links with people doing something that sounds similar to your requirement and using MQTT. It might be workth looking at all those to see if there is anything useful for you.

---

<div class="post-metadata">

**Author:** ![europer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europer/32/28437_2.png) [@europer](https://discourse.nodered.org/u/europer)\
**Post date:** [12 September 2020 15:01 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/13 "2020-09-12T15:01:55Z")

</div>

Thanks, yes I know somebody is using but the setup is a lot bigger then this one.  
Ok different question, can I in a http format send "like" a mqtt way aktiv a information to red-node? Perhaps you did answer the question before, I just want to send a status to node-red.  
Like triggering a light on and off from a browser http line to red-node?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 September 2020 15:09 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/14 "2020-09-12T15:09:53Z")

</div>

That is answered by my post describing GET and POST (sorry I keep saying PUT when I mean POST), preferably you should use a POST for this, but in your case it should be ok using a standard http request (which is GET).  
I will edit my previous posts.

---

<div class="post-metadata">

**Author:** ![europer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/europer/32/28437_2.png) [@europer](https://discourse.nodered.org/u/europer)\
**Post date:** [12 September 2020 17:53 UTC](https://discourse.nodered.org/t/trigger-from-with-url/11060/15 "2020-09-12T17:53:15Z")

</div>

Thanks, I will test around and when it works I will post here just for the record my solution, could be that someone else have the same issue
