# \[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:** 1

<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:** [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/1 "2018-09-14T17:35:40Z")

</div>

# Simple HTTP Connector For Flows

 ![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/1X/87c4800a018f6dc43d8cc6baf340aef991202d3d.jpeg)

Check it out the full description in the store : [HTTP request flow cards | Homey](https://apps.athom.com/app/com.internet)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/1X/ede140188ea82279392b931b286793699a13eac6.jpeg)

Feedback is welcome!  
Happy hacking!

19-sep-2017: Version 2.0.0 is published.  
Minor bugfixes and rewrite to SDK v2

02-01-2017: Version 1.5.0 is published. A lot has happened since 1.3.3. I added support for white-listed unauthorized API calls (check the settings page). Also added more JSONpath logic cards, a POST trigger and XML cards.  
08-08-2016: Version 1.3.3 is now published. The better logic card now supports Number typed variables.  
02-07-2016: Version 1.3.0 is now published. A new action card for setting Better Logic variables is added.  
31-05-2016: Version 1.2.1 is now published. It has now a build in timeout on request of 30 seconds. With the geek http options you can set {“url”: “[http://www.athom.com](http://www.athom.com/)”, “timeout”: milliseconds} if you want a custom timeout.  
04-05-2016: Version 1.2.0 is now published in the app store. It allows disabling the authorization on the API (restart app after settings change) and some geeky stuff with http options.  
26-04-2016: Update: version 1.0.0 is now released. It has a breaking change for API users: API calls for flow triggers now require the authorization header.

Support thread for [HTTP request flow cards | Homey](https://apps.athom.com/app/com.internet) as a continuation of the old forum thread ([https://forum.athom.com/discussion/770/app-simple-http-connector-for-flows-2-0-0/](https://forum.athom.com/discussion/770/app-simple-http-connector-for-flows-2-0-0/))

---

<div class="post-metadata">

**Author:** ![Earl\_Grey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/earl_grey/32/1500_2.png) [@Earl\_Grey](https://community.homey.app/u/Earl_Grey)\
**Post date:** [October 16, 2018, 10:03am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/2 "2018-10-16T10:03:37Z")

</div>

Basically what I want to do is using the REST api from DSMR Reader. When doing a ‘get’ you need to always include an certain (API key) header. With cURL this works just fine, but I’m now trying to let Homey extract a certain value and put it Better Logic. Is it possible to use one of the HTTP Connector cards for this?

According the API documentation you can call either:

cURL:

```
curl 'http://YOUR-DSMR-URL/api/v2/datalogger/dsmrreading' \
     -H 'X-AUTHKEY: YOUR-API-KEY' | python -m json.tool

```

Or with requests (Python):

```
import requests
import json

response = requests.get(
    'http://YOUR-DSMR-URL/api/v2/datalogger/dsmrreading',
    headers={'X-AUTHKEY': 'YOUR-API-KEY'},
)

if response.status_code != 200:
    print('Error: {}'.format(response.text))
else:
    print('Response: {}'.format(json.loads(response.text)))

```

So the question really is, how can I include a HTTP header?

---

<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:** [October 16, 2018, 7:08pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/3 "2018-10-16T19:08:47Z")

</div>

Take a look at [the advanced options](https://github.com/irritanterik/homey-http-request-actions/tree/7be3447f0bc98f1c4a0a66942d0b4bfcebc1217f#advanced-http-options).

In your case, try this:

```auto
{"method":"get","protocol":"http:","hostname":"YOUR-DSMR-URL","path":"/api/v2/datalogger/dsmrreading","headers":{"X-AUTHKEY":"YOUR-API-KEY"}}

```

---

<div class="post-metadata">

**Author:** ![Earl\_Grey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/earl_grey/32/1500_2.png) [@Earl\_Grey](https://community.homey.app/u/Earl_Grey)\
**Post date:** [October 17, 2018, 9:38pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/4 "2018-10-17T21:38:45Z")

</div>

@robertklep You are the best, this worked like a charme! Thumbs up and thank you very much! +1

---

<div class="post-metadata">

**Author:** ![Rik\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rik_post/32/8148_2.png) [@Rik\_Post](https://community.homey.app/u/Rik_Post)\
**Post date:** [December 8, 2018, 8:55pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/5 "2018-12-08T20:55:10Z")

</div>

Great app, I use it almost every day.  
Just updated Homey to the experimental 2.0 and I can’t het me http get requests to work. Is this something known or am I missing something?

---

<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:** [December 8, 2018, 9:13pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/6 "2018-12-08T21:13:37Z")

</div>

I’m not on Homey 2.x yet. Did you get an error on testing the flow?  
In the last blog from Athom they write handling web request is now native supported:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/d/dbe7d112228cb45da82ffe1e9fa9415cf9d45232.png)  
Will there still be a need for my app?

---

<div class="post-metadata">

**Author:** ![Rik\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rik_post/32/8148_2.png) [@Rik\_Post](https://community.homey.app/u/Rik_Post)\
**Post date:** [December 8, 2018, 9:17pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/7 "2018-12-08T21:17:26Z")

</div>

Hi Kevin,

Thanks for the prompt reply! I didn’t see that Athom got this now added to their own software, I will have a look at that as well.

The response I received was:

{“code”:401,“error”:“not\_logged\_in”,“error\_description”:“You need to log in to access this resource”}

I think I found why it isn’t working, the security is updated so the bearer token is always needed.  
Something to check tomorrow.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/0/046653763b5052bc84f6a727dc0b6aadb5989c3c.jpeg)

---

<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:** [December 8, 2018, 9:56pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/8 "2018-12-08T21:56:29Z")

</div>

What’s your scenario here? Do you want to trigger Homey by a GET request, or do you want to execute a GET request from a flow?

---

<div class="post-metadata">

**Author:** ![rvd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rvd/32/30796_2.png) [@rvd](https://community.homey.app/u/rvd)\
**Post date:** [December 11, 2018, 8:14am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/9 "2018-12-11T08:14:12Z")

</div>

I have the same issue. I want to trigger Homey by a GET request.

---

<div class="post-metadata">

**Author:** ![rvd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rvd/32/30796_2.png) [@rvd](https://community.homey.app/u/rvd)\
**Post date:** [December 11, 2018, 8:19am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/10 "2018-12-11T08:19:56Z")

</div>

When i use the URL with the cloudID i get the message Sorry, this Homey is not connected. The same message then when you try to connect to the old webinterface.

Is it possible that when the Homey is updatet to v2 a new bearer is created? Now i can’t find the bearer token anymore.

---

<div class="post-metadata">

**Author:** ![VanGilles](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vangilles/32/11478_2.png) [@VanGilles](https://community.homey.app/u/VanGilles)\
**Post date:** [December 14, 2018, 8:39am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/11 "2018-12-14T08:39:51Z")

</div>

Any news on this? I really enjoyed connecting my phone with tasker to trigger the homey to start a flow. Now it seems that you cannot connect anymore remotely with http. ☹

---

<div class="post-metadata">

**Author:** ![Ronald\_van\_Kuijk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronald_van_kuijk/32/3522_2.png) [@Ronald\_van\_Kuijk](https://community.homey.app/u/Ronald_van_Kuijk)\
**Post date:** [December 16, 2018, 12:57pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/12 "2018-12-16T12:57:32Z")

</div>

Making a web request from Homey is different than receiving a request. I have not found any build in solution in homey 2.0 so I’d say your app is still needed. Just seems the whitelist part is not working anymore like mentioned below

> {“code”:401,“error”:“not\_logged\_in”,“error\_description”:“You need to log in to access this resource”}

And I cannot seem to find any token in Homey 2.0

---

<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:** [December 16, 2018, 1:19pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/13 "2018-12-16T13:19:32Z")

</div>

The old bearer token mechanism is not supported with v2. I’m not sure if I will be able to get incomming requests working in a simple way with v2. The blog described a new native function though. I will look at it when v2 is stable enough for production.

---

<div class="post-metadata">

**Author:** ![Ronald\_van\_Kuijk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronald_van_kuijk/32/3522_2.png) [@Ronald\_van\_Kuijk](https://community.homey.app/u/Ronald_van_Kuijk)\
**Post date:** [December 16, 2018, 1:29pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/14 "2018-12-16T13:29:23Z")

</div>

I found [https://developer.athom.com/docs/apps/tutorial-Webhooks.html](https://developer.athom.com/docs/apps/tutorial-Webhooks.html) which talks about sending requests **to** Homey. I just hope this is not the alternative since it seems to require the cloud to work ☹ and it is not something ‘mom and dad’ could configure (your solution was way easier there).

---

<div class="post-metadata">

**Author:** ![xAPPO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/xappo/32/13726_2.png) [@xAPPO](https://community.homey.app/u/xAPPO)\
**Post date:** [December 19, 2018, 3:53pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/15 "2018-12-19T15:53:08Z")

</div>

Very keen to get this working on V2 - at the moment the compatibility is set such that it can’t be installed but I gather a lot of it works well on v2 if you already had it installed before upgrade or I assume manually CLI install it.

> “This app is incompatible with your Homey software version”

---

<div class="post-metadata">

**Author:** ![VanGilles](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vangilles/32/11478_2.png) [@VanGilles](https://community.homey.app/u/VanGilles)\
**Post date:** [December 19, 2018, 6:29pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/16 "2018-12-19T18:29:29Z")

</div>

I had the plugin installed before the update to v2 and can confirm that I can send requests from the homey to a device/website.

What doesn’t work is the other way around, from a device to homey. The missing part of the existence of a ‘bearer key’ in v2 may be the case.

---

<div class="post-metadata">

**Author:** ![VanGilles](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vangilles/32/11478_2.png) [@VanGilles](https://community.homey.app/u/VanGilles)\
**Post date:** [December 20, 2018, 7:44pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/17 "2018-12-20T19:44:30Z")

</div>

In this topic is some insights how the webhook function (GET) works what might help to trigger a flow outside homey: [Webhook GET](https://community.homey.app/t/webhook-get/5691)

---

<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:** [December 28, 2018, 11:08pm UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/18 "2018-12-28T23:08:20Z")

</div>

The problem lies in the whitelist check indeed. I received errors like:  
/api.js:42  
if (!onWhitelist(args.req.remoteAddress)) return callback(`not on whitelist`)  
^  
TypeError: Cannot read property ‘remoteAddress’ of undefined  
at Object.fn (/api.js:42:33)

I will investigate further as i’m now on v2.

---

<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:** [December 29, 2018, 8:00am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/19 "2018-12-29T08:00:29Z")

</div>

`args.req` doesn’t exist anymore, it has been removed for V2 because (paraphrasing Athom) the API can theoretically be used by protocols other than HTTP.

---

<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 5, 2019, 12:13am UTC](https://community.homey.app/t/app-pro-http-request-flow-cards-http-request-triggers-conditions-and-actions-for-flows/1684/20 "2019-01-05T00:13:11Z")

</div>

Hey guys, HTTP App whitelist function will be removed in a next V2 compatible version unfortunantly ([https://github.com/athombv/homey-apps-sdk-issues/issues/28](https://github.com/athombv/homey-apps-sdk-issues/issues/28))

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