# \[APP\]\[Pro\] HTTP request flow cards - HTTP request triggers, conditions and actions for flows

**URL:** <https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684>\
**Category:** Apps\
**Tags:** app, tools\
**Created:** [September 14, 2018, 5:35pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684 "2018-09-14T17:35:39Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [January 12, 2020, 4:56pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/82 "2020-01-12T16:56:11Z")

</div>

Thanks. Think I was trying that, but came to think now that the string maybe is too long for being saved as a better logic string, and that causes the error. Will have another go when the json isn’t empty.

(The emergency message I am trying to catchwas withdrawn, hehe.)

---

<div class="post-metadata">

**Author:** ![Erik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/erik/32/9865_2.png) [@Erik](https://community.homey.app/u/Erik)\
**Post date:** [January 12, 2020, 5:19pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/83 "2020-01-12T17:19:23Z")

</div>

Hi Rindler, next time you can check your jsonpath online with [jsonpath.com](http://jsonpath.com)

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [January 12, 2020, 5:26pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/84 "2020-01-12T17:26:29Z")

</div>

Yes, I did, and I got the string working there but not with the flow card.

---

<div class="post-metadata">

**Author:** ![Erik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/erik/32/9865_2.png) [@Erik](https://community.homey.app/u/Erik)\
**Post date:** [January 12, 2020, 5:42pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/85 "2020-01-12T17:42:11Z")

</div>

Ah, then it could be a Better Logic string length constraint indeed, or maybe some excentric character messing around.

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [January 12, 2020, 6:16pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/86 "2020-01-12T18:16:05Z")

</div>

I am 99% sure it’s the Swedish letters ÅÄÖ, which causes the errors. From this json, [http://opendata-download-metobs.smhi.se/api/version/1.0/parameter/5/station/95160/period/latest-day/data.json](http://opendata-download-metobs.smhi.se/api/version/1.0/parameter/5/station/95160/period/latest-day/data.json), I can set better logic strings from different titles which do not include some of these letters, but if I try to catch a phrase which includes ÅÄÄ I get an error.

When adding better logic strings manually from the better logic app settings view there are no issues with ÅÄÖ, and I can set really long strings, so that shouldn’t be the issue.

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [January 31, 2020, 3:40pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/87 "2020-01-31T15:40:25Z")

</div>

Do you think this could be fixed? Can’t catch strings which contains these strange letters ÅÄÖ, hehe.

---

<div class="post-metadata">

**Author:** ![kaz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kaz/32/10315_2.png) [@kaz](https://community.homey.app/u/kaz)\
**Post date:** [February 4, 2020, 11:20am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/88 "2020-02-04T11:20:11Z")

</div>

I don’t know if I’m just stupid 🙂 but i’m not to much into https authentication.

So i’m trying to call an api function via a HTTPS GET

here is my json formatted request (as per advanced instruction) - so an A20 GET with the below in the URL field.

```
{
	"hostname": "192.168.1.11",
	"port": "55756",
	"method": "GET",
	"protocol": "https:",
	"auth": "theusername:thepassword",
	"path": "/Acs/Api/TriggerFacade/ActivateDeactivateTrigger?{triggerName:Record_6115,deactivateAfterSeconds:5}",
	"headers": {
		"user-agent": "Node.js http.min"
	}
}

```

But I can not get it to work. Any help / pointers appreciated.  
It is to call Axis Camera Station Web Api. It works fine as browser command.

I have tried PORT with and without quotes.

But homey discards with “Promise was rejected with a falsy value”

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 4, 2020, 12:00pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/89 "2020-02-04T12:00:22Z")

</div>

According to the documentation that I can find, the query string part of `path` needs to contain valid JSON, which it doesn’t in your case.

Try this:

```auto
"path" : "/Acs/Api/TriggerFacade/ActivateDeactivateTrigger?{\"triggerName\":\"Record_6115\",\"deactivateAfterSeconds\":5}"

```

---

<div class="post-metadata">

**Author:** ![kaz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kaz/32/10315_2.png) [@kaz](https://community.homey.app/u/kaz)\
**Post date:** [February 4, 2020, 12:56pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/90 "2020-02-04T12:56:47Z")

</div>

Hi Robert,

thanks. I tried multiple variations and none of them worked.

I’ll continue my quest - if anyone else have ideas let me know please.

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [February 8, 2020, 9:36am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/92 "2020-02-08T09:36:36Z")

</div>

![Screenshot_20200208-103102_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/7/171e22c28adba8ca31117c4bcd93fbaddb1ba3b6.jpeg)  
Anyone who could help how to write a valid condition? Want to sort out the values which are above 500.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 8, 2020, 9:39am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/93 "2020-02-08T09:39:01Z")

</div>

Have you tried `> 500` as condition?

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [February 8, 2020, 9:51am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/94 "2020-02-08T09:51:43Z")

</div>

Actually I want the value to be less than 500, but yes I have tried \< 500, “\< 500”, {{\< 500}} and similar, and I just get a red exclamation mark (even though the value in my test is really low).

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 8, 2020, 11:11am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/95 "2020-02-08T11:11:35Z")

</div>

In the browser version ([http://flow.athom.com/](http://flow.athom.com/)) you should be able to hover over the exclamation mark and see the error.

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [February 8, 2020, 1:57pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/96 "2020-02-08T13:57:10Z")

</div>

Hm. Tried to hover, but it didn’t say anything. Found this site, [http://jsonlogic.com/operations.html#---and-](http://jsonlogic.com/operations.html#---and-), but still don’t manage to get it right.

---

<div class="post-metadata">

**Author:** ![volodeev](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/volodeev/32/12304_2.png) [@volodeev](https://community.homey.app/u/volodeev)\
**Post date:** [March 16, 2020, 5:30pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/97 "2020-03-16T17:30:14Z")

</div>

Hello, I’m trying to send a POST request using the A22 card. I tested this successfully with the following command:

curl -v -X POST -d ‘{“slid\_token”: “f6e706e17d41ce781b5166f09e782fd0: 1663”}’ [https://developer.starline.ru/json/v2/auth.slid](https://developer.starline.ru/json/v2/auth.slid)

Is there a way to build this into an homey action card A22?  
I believe, I got stuck because requires a plain text type.

---

<div class="post-metadata">

**Author:** ![volodeev](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/volodeev/32/12304_2.png) [@volodeev](https://community.homey.app/u/volodeev)\
**Post date:** [March 20, 2020, 6:31pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/98 "2020-03-20T18:31:27Z")

</div>

> [@VanGilles](#):
>
> Can anyone help me how I can send a GET command with two cookies?
> 
> It is something like “https://…{Cookie=xxx=yyy; xxx =yyy}” with the cookie in the header brackets but don’t know if the default GET card will accept this syntax.
> 
> I want to send out this GET command to a server to get a reply with a JSON file which I want to store some variables in Better Logic. Without the cookies I don’t get replied with a JSON file.

Tell me how to get cookies?

---

<div class="post-metadata">

**Author:** ![volodeev](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/volodeev/32/12304_2.png) [@volodeev](https://community.homey.app/u/volodeev)\
**Post date:** [March 20, 2020, 6:33pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/99 "2020-03-20T18:33:59Z")

</div>

So it happened {“method”:“post”,“protocol”:“https:”,“hostname”:“[developer.starline.ru](http://developer.starline.ru)”,“path”:"/json/v2/auth.slid", **“json”:{“slid\_token”:“f6e706e17d41ce781b5166f09e782fd0: 1663”}**

---

<div class="post-metadata">

**Author:** ![Raytestrak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/raytestrak/32/3299_2.png) [@Raytestrak](https://community.homey.app/u/Raytestrak)\
**Post date:** [May 5, 2020, 8:32pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/100 "2020-05-05T20:32:42Z")

</div>

I’m trying something and since I’m no programmer this is a bit out of my league.

My router has OpenWRT and adblock, but … I want to suspend adblock temporarily with Homey. I had this in the past for PiHole with a GET command. But PiHole is running in docker on my NAS and when datascrubbing is taking place, the performance of docker becomes so bad my DNS fails and my wife has no internet. Big problem for me. So, I turned to adblock on OpenWRT. Works good to, but no easy way to disable it. It works from the commandline on my computer, but now to get it working in Homey.

First, I have to get a token:

curl https:// **router-ip** /cgi-bin/luci/rpc/auth --insecure --data '{“id”: 1, “method”: “login”, “params”: [“ **username\>** ”, “ **password** ”]}

This gives me a result like:  
{“id”:1,“result”:“ **token** ”,“error”:null}

Those are my first two problems. I need to get the token stored in a variable and I need to make an insecure call (router is running a self signed certificate).

Then, to get it running in Homey, I need to translate this command into something Homey will understand:

curl -X POST https:// **router-ip** /cgi-bin/luci/rpc/sys?auth= **token** --insecure --data ‘{“id”: “1”, “method”: “exec”, “params”: ["/etc/init.d/adblock suspend"]}’

I tried a POST JSON card with these options:

- https:///cgi-bin/luci/rpc/sys?auth=
- {“id”: “1”, “method”: “exec”, “params”: ["/etc/init.d/adblock suspend"]}

But that gives me an error: Unexpected Token E in JSON at position 0

The maker of adblock pointed me to a different, simpler solution. A simple [web request](https://forum.openwrt.org/t/is-there-a-way-to-script-enabling-disabling-a-fw-traffic-rule/10557/4?u=dibdot) that executes a custom command on the router. This works, but how to trigger that from Homey.

So I have two working solutions, but now to get either in them in a Homey flow. Any ideas?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 6, 2020, 5:48am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/101 "2020-05-06T05:48:51Z")

</div>

> [@Raytestrak](#):
>
> The maker of adblock pointed me to a different, simpler solution. A simple [web request](https://forum.openwrt.org/t/is-there-a-way-to-script-enabling-disabling-a-fw-traffic-rule/10557/4?u=dibdot) that executes a custom command on the router. This works, but how to trigger that from Homey.

There’s a flow action card called “Maak een webverzoek” (Make a web request):  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/07c06f6842e18f7ba27f66ba705d04377529d253.png)

---

<div class="post-metadata">

**Author:** ![Raytestrak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/raytestrak/32/3299_2.png) [@Raytestrak](https://community.homey.app/u/Raytestrak)\
**Post date:** [May 6, 2020, 6:31am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/102 "2020-05-06T06:31:21Z")

</div>

The custom command is something like this: https:// **router-ip** /cgi-bin/luci/command/cfg099944s, which suspends adblock on the router. I have another one for resume. The url opens a website that informs me that the command has run succesfully:

![customcommand](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/b/fb7bbc3143d8082bd382cc6f47261af12769fb9c.png)

I don’t understand how to use this in Homey, the webrequest card asks has four input fields:

 ![webrequest](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/4/14045392651a3b642a7f53fa5912e2c9695b5d31.png)

This looks to me like the json based curl command for the ‘complex’ solution.

[Previous page](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684.md?page=4)

[Next page](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684.md?page=6)
