Can't make GET API work?
-
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:
Result:
{"err":"Invalid Token!"}I tried both with and without the parenthesis "(" and ")" around the token...same result.
-
Ok, I solved it but I made 3 changes and am not sure which it was:
- Got rid of parenthesis in token (obviously this is a must)
- Renamed trigger without underscore "_"
- Changed trigger to foreground from background so that it showed on the webpage
-
@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.