Page 1 of 1

shells script help for IFTTT and Webhooks

PostPosted: Wed Oct 02, 2019 5:31 am
by Sofabutt
I am trying to execute a shell script from within Applescript but can't figure out the proper command.

The script I get from WebHooks looks like this:

Code: Select all
do shell script "curl -X POST -H "Content-Type: application/json" -d '{"value1":"Garage","value2":"Door","value3":"Alert"}' https://maker.ifttt.com/trigger/Notify/with/key/abcdefghijklmnopqrstuvwxyz"


The only thing I can get to work, albeit without passing the variables to WebHooks, is this:

Code: Select all
do shell script "curl -d 'data1=Garage&data2=door&text3=Alert' https://maker.ifttt.com/trigger/Garage_Door_Alert/with/key/abcdefghijklmnopqrstuvwxyz"


I'd like to be able to change the data fields to suit the alarms and motion detectors that are going off around the house, but I don't know how to pass the variable.

Can anyone please help?

Re: shells script help for IFTTT and Webhooks

PostPosted: Wed Oct 02, 2019 6:29 am
by FlyingDiver
First things first. Where are you running this command? From inside Indigo? Because you really need to be getting away from using AppleScript wherever possible.

Second, have you looked at using the IFTTT plugin to make the call? http://www.indigodomo.com/pluginstore/49/. I think it would work for this use case.

If that doesn't work, doing this with a simple Python script is easy.