TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Parameters are now supported via IFTTT, Tasker, and curl API's

    Announcements
    1
    1
    2.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RussR
      Russ
      last edited by Russ

      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.

      Parameters GUI

      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\"}"
      

      Russell VanderMey

      1 Reply Last reply Reply Quote 0
      • RussR Russ referenced this topic on
      • First post
        Last post