# API problem

**URL:** <https://community.homey.app/t/api-problem/108678>\
**Category:** Questions & Help\
**Created:** [April 22, 2024, 8:31pm UTC](https://community.homey.app/t/api-problem/108678 "2024-04-22T20:31:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [April 22, 2024, 8:31pm UTC](https://community.homey.app/t/api-problem/108678/1 "2024-04-22T20:31:28Z")

</div>

Hi there, I want to get data from my Homey, via API using Node-red

I have made the flow below, according to this guide:

> **[Getting started with API Keys](https://support.homey.app/hc/en-us/articles/8178797067292-Getting-started-with-API-Keys)**
>
> Homey Pro (Early 2023) offers a feature called API Keys, that's intended for hobbyists and developers to create integrations with their Homey Pro.
> 1. Creating the API Key
> To create an API Key, navi...

But as you see in the debug, i only get the homey verson and ID. What am I doing wrong?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/2/c2fffb51a3def80576225c609999aaa5667dfdbd.png)

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 22, 2024, 8:45pm UTC](https://community.homey.app/t/api-problem/108678/2 "2024-04-22T20:45:31Z")

</div>

Because you are not specifying any API, you just gets the default response.

---

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [April 22, 2024, 8:48pm UTC](https://community.homey.app/t/api-problem/108678/3 "2024-04-22T20:48:16Z")

</div>

Uhm, okay. How do I specify the API?

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 22, 2024, 8:50pm UTC](https://community.homey.app/t/api-problem/108678/4 "2024-04-22T20:50:16Z")

</div>

> **[Welcome to the Web API documentation 👋 | Homey Web API](https://api.developer.homey.app/)**
>
> 🌍 Learn how to build great integrations.

---

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [April 22, 2024, 8:54pm UTC](https://community.homey.app/t/api-problem/108678/5 "2024-04-22T20:54:04Z")

</div>

Thanks, ive seen that. But thats not for Node-red, so I still don’t get how I can get it to work in node red

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 22, 2024, 8:59pm UTC](https://community.homey.app/t/api-problem/108678/6 "2024-04-22T20:59:38Z")

</div>

I have no knowledge of node-red, but In the URL you have to define which API you want to use. Like /api/manager/clock/state  
And you have to use the API key in your requests. Just read the documentation you referred to:

```auto
GET /api/manager/devices/device/ HTTP/1.1
Host: 192.168.0.123
Authorization: Bearer <your api key>`

```

---

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [April 22, 2024, 9:10pm UTC](https://community.homey.app/t/api-problem/108678/7 "2024-04-22T21:10:36Z")

</div>

Thanks,

So, I guess the URL should then be:  
[https://192-168-1-116.homey.homeylocal.com/api/manager/devices/device/](https://192-168-1-116.homey.homeylocal.com/api/manager/devices/device/) HTTP/1.1

But, that returns “null”. I’ve also tried that from ignition. Which also returns an error… Do i need to use headers? If so, what should they be?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/c/fc07b8a41c187c95efcd9a72cf0189129d5f094f.png)

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 22, 2024, 9:15pm UTC](https://community.homey.app/t/api-problem/108678/8 "2024-04-22T21:15:52Z")

</div>

For implementation details I have to read the manuals. It looks like you should do too. Maybe you can find an example somewhere.

When I type the URL in a browser

[http://192.168.178.101/api/manager/devices/device](http://192.168.178.101/api/manager/devices/device)

I get a nice error message as no authitencation is provided. This way you can find out where your problem is: in your API or in your development tool.

---

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [April 22, 2024, 9:42pm UTC](https://community.homey.app/t/api-problem/108678/9 "2024-04-22T21:42:29Z")

</div>

wow!  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/3/a3e93a6b397291cf8804190d88d43d83bf9cbfca.png)

Like that as you said, i get a lot of info from Homey, so that works! Thanks, then i get how its works and how I can use the URL to get the data i want 🙂

EDIT:  
Nope, it actually only work for that specific URL… 😕

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 22, 2024, 9:53pm UTC](https://community.homey.app/t/api-problem/108678/10 "2024-04-22T21:53:10Z")

</div>

> [@Garrian](#):
>
> Nope, it actually only work for that specific URL

I don’t understand this remark. Please explain your problem a little more.

Here are the other URL’s for all the API’s : [HomeyAPIV3Local - Homey Web API](https://athombv.github.io/node-homey-api/HomeyAPIV3Local.html)

Maybe you can use Telnet to make the HTTP request yourself

```auto
GET /api/manager/devices/device/ HTTP/1.1
Host: 192.168.0.123
Authorization: Bearer <your api key>`

```

And then try your development tool to get the same response.

---

<div class="post-metadata">

**Author:** ![Garrian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garrian/32/79451_2.png) [@Garrian](https://community.homey.app/u/Garrian)\
**Post date:** [April 23, 2024, 5:14pm UTC](https://community.homey.app/t/api-problem/108678/11 "2024-04-23T17:14:21Z")

</div>

Nevermind I got the GET functions to work. Is it possible to activate a flow, using HTTP Post function? If so, can you show me an example for how to use it?

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 23, 2024, 8:11pm UTC](https://community.homey.app/t/api-problem/108678/12 "2024-04-23T20:11:28Z")

</div>

You want to run a flow on Homey to start an API to get information from Homey?  
That seems weird. I thought you were trying to get information from Homey to some other system. Could you describe what you try to accomplish and which systems are involved?

Use a THEN logic card in a flow to make a HTTP request.

By the way, it would be nice and interesting for other users to show how you solved your problem.
