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

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

    Scheduled Pinned Locked Moved Announcements
    1 Posts 1 Posters 3.2k Views 1 Watching
    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 Offline
      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

      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
      • First post
        Last post