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

    Can't make GET API work?

    General Discussion
    2
    3
    745
    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.
    • I
      Insaneoctane
      last edited by

      So I'm new to triggercmd. Here's what I'm trying to do (and failing at). I want to verify that my GET command works before using smartthings to do the same. I'm just pasting this into my browser and it's returning that the token is invalid. So then I went to the instructions page and I noticed that the token changes every time I refresh??? What am I missing?

      Here's my command pasted into browser:

      https://www.triggercmd.com/api/run/triggerSave?computer=zeus&trigger=Say_hello&token=(XXXXXXXXXXXXXXXX)

      Result:
      {"err":"Invalid Token!"}

      I tried both with and without the parenthesis "(" and ")" around the token...same result.

      1 Reply Last reply Reply Quote 0
      • I
        Insaneoctane
        last edited by

        Ok, I solved it but I made 3 changes and am not sure which it was:

        1. Got rid of parenthesis in token (obviously this is a must)
        2. Renamed trigger without underscore "_"
        3. Changed trigger to foreground from background so that it showed on the webpage
        RussR 1 Reply Last reply Reply Quote 0
        • RussR
          Russ @Insaneoctane
          last edited by

          @insaneoctane, I'm sure it was #3.

          It has to show up on the webpage before you can trigger the command with the API, and background commands don't show up until you install the background service. That background service feature is often misunderstood. I almost wish I didn't include it. It's meant to allow you to trigger commands in the context of a Windows service or a Linux daemon so you don't have to be logged in for the commands to run.

          Russell VanderMey

          1 Reply Last reply Reply Quote 0
          • First post
            Last post