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

    Issue when passing URL as parameter

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 830 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.
    • C Offline
      Caio Kenup
      last edited by

      I have the very simple trigger that runs

      curl [params]
      

      So I can make GET requests to a local address remotely via the triggerCMD API. (If you think this is a work around using localtunnel or ngrok, it is exactly that)

      My triggerCMD API request looks like this

      https://www.triggercmd.com/api/run/triggerSave?computer=<MY_COMPUTER>&trigger=curl&token=<MY-TOKEN>&params="http://localhost:4040/webhook/id?par1=1&par2=b&par3=temp"

      The request only passes the first argument (par1 = 1), making me think the "&" character is improperly interpreted, despite being between quotes.

      The curl command runs correctly through the terminal

      curl "http://localhost:4040/webhook/id?par1=1&par2=b&par3=temp"
      

      passing all three arguments, again adding weight to the possibility that the API call is doing something to URL when passed as parameter.

      Any insight on how I could get this to work would be greatly appreciated!

      RussR Felipe FanchiniF 2 Replies Last reply Reply Quote 0
      • RussR Offline
        Russ @Caio Kenup
        last edited by

        @caio-kenup, I'll mention this setting in your profile, but you may have already found it:

        f4d4760b-e767-4f47-9922-3d08d5143092-image.png

        I blocked those characters by default because they could be used to run arbitrary commands if parameters are enabled.

        A safer way to do what you're trying to do would be to use a script that takes a series of parameters like this:

        Linux/Mac bash script:

        set -x
        curl "http://localhost:4040/webhook/id?par1=$1&par2=$2&par3=$3"
        

        Make it executable with chmod +x ./script.sh
        Test it with: ./script.bat a b c

        Windows script:

        curl "http://localhost:4040/webhook/id?par1=$1&par2=$2&par3=$3"
        

        Test it with: script.bat a b c

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • Felipe FanchiniF Offline
          Felipe Fanchini @Caio Kenup
          last edited by Xander

          @Caio-Kenup I solved this problem including ^ just before &. So, as an example, I changed

          start www.youtube.com/watch?v=dQw4w9WgXcQ&autoplay=1
          

          to

          start www.youtube.com/watch?v=dQw4w9WgXcQ^&autoplay=1
          

          I believe that it will works to everybody that has a URL with character "&"

          1 Reply Last reply Reply Quote 0

          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