Want to call http post from either script or switch

Hello, I have an endpoint I would like to invoke with either a switch or a script. It looks like this:

https://webhooks.stringify.com/v1/events/mysecretkey

It cannot parse parameters, I simple call the web string and the flow I want to invoke with stringify happens. How would I call this from Home Assistant?

You can execute an http post command using IFTTT. In IFTTT, use the “Maker Webhooks” component.

https://home-assistant.io/components/ifttt/

Let me know if you need any assistance. Good luck.

Already doing that. Sometimes have huge delays using IFTTT which is why I want to call stringify directly. But thanks :slight_smile:

1 Like

A command line switch should do the trick.

Looks like it. Thanks… Any clue to how I would format:

command_on: “/usr/bin/curl -X GET http://192.168.1.10/digital/4/1”

I am on windows but assuming it would just be:

command_on: "/usr/bin/curl -X POST https://webhooks.stringify.com/v1/events/mysecretkey1 ?

I use shell_commands for these.

commandname: curl --silent -k "http://< URL >"

(curl defaults to GET)

Then to call it from a script or automation:

- service: shell_command.commandname
1 Like

First, you have to install curl for windows : curl - Download
Then you can call it like this:

c:\<pathToCurl>\curl -X GET -H "Content-Type: application/json" http://<url>

The content-type header may, or may not be required depending upon your implementation.
I put my curl command in a batch file. That way I can get it running before I try to integrate it into Home Assistant.

This really helped me. Thanks.

1 Like