Get Make API call request header info?

For a while I've been experiencing a behavior where this light over my workbench was turning off spontaneously. I have a rule that if the room is unoccupied for a while, it should turn off the lights, but it wasn't turning off the overhead light. I spent some time investigating and finally discovered that the Maker API app I had set up was what was causing the light to turn off.

Meaning, something on my local network is making an HTTP request to send an off command to that device. Thing is, I don't know what is doing that.

Is there any way to log information about the Maker API requests that come in, like remote IP and request headers?

Not that I'm aware of, but presumably you have that Maker API instance in use with some service on your LAN? If so, does that service provide a way to tell you what it's doing and when? You can try resetting the Maker API access token and also "re-authenticating" or whatever you'd need to do with the new token in that service if you think it's coming from some place else (it won't work without a valid access token, though it is part of the URL and easily visible if you're not using HTTPS).

That's the problem, is I can't find whatever it is that's making the requests. Seeing the request headers and remote IP would help me track it down. I disabled the API, and it stopped the behavior (it seems), but nothing is obviously reporting errors.

If you remove the Maker API instance instead of disabling it, you'll get warnings in your logs with the source IP address, which could help you figure it out. Make a hub backup or export the Maker API app (from the app status/gear icon page), or both, so you can restore it later -- assuming you still need it.

(I don't think resetting the access token will give you any logs on the hub if it fails, but that would at least stop it from working...)

One more idea that migth help you figure it out!

2 Likes