Parameters are now supported via IFTTT, Tasker, and curl API's
-
Now you can send parameters to your commands via the API's.
You'll need to upgrade your agent, then enable parameters on each command you want to be able to send parameters to. For security, it's turned off by default.
Here's the format on a Linux box or Mac (uses single-quotes):
curl -X POST https://www.triggercmd.com/api/run/triggerSave -H 'authorization: Bearer (insert token here)' -H 'content-type: application/json' -d '{"computer":"(insert computer name here)","trigger":"notepad","params":"russ.txt"}'Here's an actual command I tested on my Windows box. Notice 2 things:
- Curl on Windows uses double quotes
- Because the body of this POST is in JSON format, you have to use backslashes (\'s) to "escape" some characters including backslashes and quotes.
curl -X POST https://www.triggercmd.com/api/run/triggerSave -H "authorization: Bearer (token from instructions page)" -H "content-type: application/json" -d "{\"computer\":\"DS\",\"trigger\":\"notepad\",\"params\":\"c:\\users\\Russ\\.TRIGGERcmdData\\commands.json\"}"You can also pass the "param" value as a URL parameter like this:
curl -X POST https://www.triggercmd.com/api/run/triggerSave?params=russ.txt -H "authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU4NzczYTE5NzFiMThlMGIwYmZjMDM3NiIsImlhdCI6MTUwNDM4MDcyMX0.KO9o8UZz3NX_8y0EcTNrX9LPz819WRHtMP3qrshA6hY" -H "content-type: application/json" -d "{\"computer\":\"DS\",\"trigger\":\"notepad\"}" -
R Russ referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login