API problem

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:

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

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

Uhm, okay. How do I specify the API?

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

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:

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

Thanks,

So, I guess the URL should then be:
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?

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

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.

wow!
image

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 :slight_smile:

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

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

Maybe you can use Telnet to make the HTTP request yourself

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.

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?

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.