<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Use curl to run a command via the API.]]></title><description><![CDATA[<p dir="auto">curl -X POST <br />
<a href="https://www.triggercmd.com/api/run/triggerSave" rel="nofollow ugc">https://www.triggercmd.com/api/run/triggerSave</a> <br />
-H 'authorization: Bearer <strong>(insert token here)</strong>' <br />
-H 'content-type: application/json' <br />
-d '{"computer":"<strong>(insert computer name here)</strong>","trigger":"<strong>(insert trigger name here)</strong>"}'</p>
<p dir="auto">Reminder - your computer name is different from your voice trigger for your computer.</p>
<p dir="auto">Also, if you run this on Windows, you'll need to download the Windows version of <a href="http://www.confusedbycode.com/curl/#downloads" rel="nofollow ugc">curl</a>, and use double quotes (") instead of single quotes (').  See <a href="https://www.triggercmd.com/forum/topic/72/parameters-are-now-supported-via-ifttt-tasker-and-curl-api-s">this article</a> for more about how to do this on Windows.</p>
<p dir="auto">Curl works great, but an easier way to trigger commands from the command line is to use the <a href="https://www.triggercmd.com/forum/topic/196/tcmd-go-command-line-tool-is-available-now">tcmd utility</a>.</p>
<p dir="auto">EDIT 2/27/21:  Now you can trigger commands on computers people have shared with you.  They show up under "Other users's computers."</p>
<p dir="auto">EDIT 12/14/2022:  Also see <a href="https://www.triggercmd.com/forum/topic/2466/trigger-your-commands">this Python code</a>.</p>
]]></description><link>https://www.triggercmd.com/forum/topic/25/use-curl-to-run-a-command-via-the-api</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 04:04:20 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/topic/25.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 May 2017 01:30:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Use curl to run a command via the API. on Thu, 27 Jan 2022 11:28:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@russ</a> Thanks</p>
]]></description><link>https://www.triggercmd.com/forum/post/5421</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5421</guid><dc:creator><![CDATA[David Jones]]></dc:creator><pubDate>Thu, 27 Jan 2022 11:28:52 GMT</pubDate></item><item><title><![CDATA[Reply to Use curl to run a command via the API. on Thu, 27 Jan 2022 11:28:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/13362">@tuicemen</a> Thanks to you both I got it to work. <img src="https://www.triggercmd.com/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=6sa9akdcpc2" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /><br />
I write the temperature and humidity to a text file as one command in the master script that is called by the RPi TRIGGERcmd command on the RPi. The master then reads it and it gets merged into the curl command. The curl command then activates a TRIGGERcmd command on the desktop that then casts to the Google nest!  Nb I am using .NET 6 on the RPi. I'll blog about this in detail in coming days. See blog site (first link).</p>
]]></description><link>https://www.triggercmd.com/forum/post/5420</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5420</guid><dc:creator><![CDATA[David Jones]]></dc:creator><pubDate>Thu, 27 Jan 2022 11:28:01 GMT</pubDate></item><item><title><![CDATA[Reply to Use curl to run a command via the API. on Wed, 26 Jan 2022 13:25:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/13503">@david-jones</a>, good question, it's actually <strong>params</strong> instead of parameter.</p>
<p dir="auto">Also, instead of curl you could also use the <a href="https://www.triggercmd.com/forum/topic/591/tcmd-go-client-added-support-for-a-quoted-string-with-spaces-for-the-params-parameter?_=1643202962211">tcmd go cli tool</a>.</p>
]]></description><link>https://www.triggercmd.com/forum/post/5395</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5395</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Wed, 26 Jan 2022 13:25:07 GMT</pubDate></item><item><title><![CDATA[Reply to Use curl to run a command via the API. on Wed, 26 Jan 2022 13:37:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/13503">@david-jones</a> It depends on what parameters you want. The on off dim parameters come from Alexa, Google . The parameter option in the commands.json line only excepts true or false.<br />
If you need another parameter it goes in your command. See how  I did it here<br />
<a href="https://www.triggercmd.com/forum/topic/1962/say-room-temperature-and-humidity">https://www.triggercmd.com/forum/topic/1962/say-room-temperature-and-humidity</a> parameters in my case were 4 and 22</p>
]]></description><link>https://www.triggercmd.com/forum/post/5391</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5391</guid><dc:creator><![CDATA[tuicemen]]></dc:creator><pubDate>Wed, 26 Jan 2022 13:37:12 GMT</pubDate></item><item><title><![CDATA[Reply to Use curl to run a command via the API. on Wed, 26 Jan 2022 07:17:03 GMT]]></title><description><![CDATA[<p dir="auto">And how would you add a parameter to the trigger? Would it be something like?:</p>
<pre><code>-d '{"computer":"(insert computer name here)","trigger":"(insert trigger name here)","parameter":"(insert parameter here)"}'
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/post/5388</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5388</guid><dc:creator><![CDATA[David Jones]]></dc:creator><pubDate>Wed, 26 Jan 2022 07:17:03 GMT</pubDate></item></channel></rss>