# Webapi

**URL:** <https://community.homey.app/t/webapi/11194>\
**Category:** Questions & Help\
**Created:** [March 30, 2019, 10:14am UTC](https://community.homey.app/t/webapi/11194 "2019-03-30T10:14:08Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 10:14am UTC](https://community.homey.app/t/webapi/11194/1 "2019-03-30T10:14:09Z")

</div>

I have just migrated to Homey 2.0. I have waited a long time so that ‘all’ problems and bugs where solved.

But unfortunately I ran into a problem. I can’t access the webapi anymore from my mobile phone. I use that to automatically switch on/off my alarm when leaving or coming home.  
I know that there is a new bearer token but still can’t acces the webapi.

Does anyone know what has been changed?

---

<div class="post-metadata">

**Author:** ![Peter\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_post/32/276_2.png) [@Peter\_Post](https://community.homey.app/u/Peter_Post)\
**Post date:** [March 30, 2019, 10:39am UTC](https://community.homey.app/t/webapi/11194/2 "2019-03-30T10:39:53Z")

</div>

Correct me if i’m wrong but V2.X doesn’t have webacces anymore. You can edit flow through you’re browser with [https://flow.homey.app/](https://flow.homey.app/).

---

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 10:44am UTC](https://community.homey.app/t/webapi/11194/3 "2019-03-30T10:44:19Z")

</div>

@Peter_Post, I 'am not talking about access to flows ‘the old way’ but access to the webapi

---

<div class="post-metadata">

**Author:** ![Peter\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_post/32/276_2.png) [@Peter\_Post](https://community.homey.app/u/Peter_Post)\
**Post date:** [March 30, 2019, 10:55am UTC](https://community.homey.app/t/webapi/11194/4 "2019-03-30T10:55:18Z")

</div>

there is no old way. [https://flow.homey.app/](https://flow.homey.app/) is the new way

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [March 30, 2019, 11:02am UTC](https://community.homey.app/t/webapi/11194/5 "2019-03-30T11:02:09Z")

</div>

The web API is just working but you need to be authenticated.  
It is still possible by stealing the bearer token but that one is longer and changing periodically.  
Other way is using the provided authentication  
[https://developer.athom.com/api/projects](https://developer.athom.com/api/projects)

---

<div class="post-metadata">

**Author:** ![Peter\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_post/32/276_2.png) [@Peter\_Post](https://community.homey.app/u/Peter_Post)\
**Post date:** [March 30, 2019, 11:11am UTC](https://community.homey.app/t/webapi/11194/6 "2019-03-30T11:11:20Z")

</div>

That’s the developer page. Not the flow editor.  
But it’s possible that I don’t understand what tb1962 is trying to do.

---

<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:** [March 30, 2019, 1:01pm UTC](https://community.homey.app/t/webapi/11194/7 "2019-03-30T13:01:05Z")

</div>

I assume you mean that your mobile phone was making HTTP requests to Homey? If so, what were the URL’s that you use?

---

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 1:13pm UTC](https://community.homey.app/t/webapi/11194/8 "2019-03-30T13:13:16Z")

</div>

@robertklep: The url that i used with vs Homey 1.5x is (just an example):  
https://.homey.athom.com/api/app/net.i-dev.betterlogic//1

---

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 1:19pm UTC](https://community.homey.app/t/webapi/11194/9 "2019-03-30T13:19:58Z")

</div>

@Dijker: That api is only for local access. Not for remote access via my phone

---

<div class="post-metadata">

**Author:** ![anne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anne/32/10393_2.png) [@anne](https://community.homey.app/u/anne)\
**Post date:** [March 30, 2019, 1:22pm UTC](https://community.homey.app/t/webapi/11194/10 "2019-03-30T13:22:15Z")

</div>

You have the Better Logic app for V2 installed, right?

In that case all you need to do is lookup the new style bearer token and use it in the URL to post data to Homey, just like you used it in V1.

---

<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:** [March 30, 2019, 1:24pm UTC](https://community.homey.app/t/webapi/11194/11 "2019-03-30T13:24:46Z")

</div>

Those URL’s won’t work anymore without authentication. I assume (can’t remember) that they used to work on v1.5 without authentication?

You might want to take a look at [this tutorial](https://community.homey.app/t/tutorial-using-siri-shortcuts-for-activating-flows-with-pics/7473) that uses the HTTP Request Flow Cards app to trigger flows on incoming HTTP requests (even though the tutorial is for iOS, it gives you the info you need to act on incoming HTTP requests, no matter where those requests are coming from).

---

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 1:26pm UTC](https://community.homey.app/t/webapi/11194/12 "2019-03-30T13:26:26Z")

</div>

@anne, Yes i have tried that. but it didn’t work. I have used the long 3 part bearer token in the header. Also tried a slightly differend url that i found somewhere:  
https://.homey.athom.com/api/manager/apps/app/net.i-dev.betterlogic// but also with no luck

---

<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:** [March 30, 2019, 1:30pm UTC](https://community.homey.app/t/webapi/11194/13 "2019-03-30T13:30:46Z")

</div>

The URL should start with `https://CLOUDID.connect.athom.com`

---

<div class="post-metadata">

**Author:** ![anne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anne/32/10393_2.png) [@anne](https://community.homey.app/u/anne)\
**Post date:** [March 30, 2019, 1:42pm UTC](https://community.homey.app/t/webapi/11194/14 "2019-03-30T13:42:22Z")

</div>

It works for me, although I only use it locally. The URL you posted is not complete, you need to specify an endpoint which you can match in a flow?

Something like this (only snippet I have handy at the moment, a curl system call from Python)…

os.system(’/usr/bin/curl -H “HOST: (Homey IP)” -H “Authorization: Bearer (bearertoken)” -H “Content-Type:application/x-www-form-urlencoded” -X POST (Homey IP)/api/app/com.internet/eastron --data “power={0:.3f}”’.format(Active\_Power))

In a flow triggercard you can match the ‘eastron’ endpoint and extract the value for the ‘power’ varable.

---

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 3:25pm UTC](https://community.homey.app/t/webapi/11194/15 "2019-03-30T15:25:36Z")

</div>

> [@tb1962](#):
>
> https://.homey.athom.com/api/manager/apps/app/net.i-dev.betterlogic//

Sorry. Something went wrong when copying text. The url should be: [https://CLOUDID.homey.athom.com/api/manager/apps/app/net.i-dev.betterlogic/VARNAME/VALUE](https://CLOUDID.homey.athom.com/api/manager/apps/app/net.i-dev.betterlogic/VARNAME/VALUE)

---

<div class="post-metadata">

**Author:** ![tb1962](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tb1962/32/7888_2.png) [@tb1962](https://community.homey.app/u/tb1962)\
**Post date:** [March 30, 2019, 4:26pm UTC](https://community.homey.app/t/webapi/11194/16 "2019-03-30T16:26:06Z")

</div>

@robertklep. Thanx Robert. That works liker a charm.

---

<div class="post-metadata">

**Author:** ![anne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anne/32/10393_2.png) [@anne](https://community.homey.app/u/anne)\
**Post date:** [April 4, 2019, 5:59am UTC](https://community.homey.app/t/webapi/11194/17 "2019-04-04T05:59:29Z")

</div>

Note that in v2.1.1 the bearer token will change daily, effectively breaking this setup 😑
