Difference between revisions of "Trigger: Webhook (URL)"

m
Line 38: Line 38:
 
More information here.
 
More information here.
 
https://medium.com/@macrodroid/introducing-the-webhook-trigger-a760e2ee140d
 
https://medium.com/@macrodroid/introducing-the-webhook-trigger-a760e2ee140d
 
+
<br><br>
 
'''Example Usage'''<br/>
 
'''Example Usage'''<br/>
 
This macro will receive values by webhook and speak them by TTS.
 
This macro will receive values by webhook and speak them by TTS.
Line 53: Line 53:
 
</pre><br>
 
</pre><br>
 
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
Constrains
+
Constraints
  
  

Revision as of 08:19, 25 May 2023

This trigger will fire on this device when the specified web URL is called from anywhere.

WARNING:

that the URL is unique to this device and the URL will change if the application is reinstalled (or all application data is deleted).

This feature uses Firebase Cloud Messaging to notify the device via the backend server, therefore it is not functional on devices that lack Google services (such as Alexa tablets etc.)

SENDING PARAMETERS:

In addition to an identifier it is also possible to send URL parameters to the trigger which are then used to set MacroDroid Variables. The format for sending parameters is as follows:

PARAMETERS OF EXAMPLES:

ID = User-defined identifier.

VARNAME1 = The first variable to be defined, in this case with a numerical value.

VARNAME2 = The second variable to be defined, in this case with a plain-text value

DATA = Dictionary.

(KEY) = The key you are defining in your Dictionary / Array.

 = After this sign goes the value you want to send in the webhook.

To set a variable:
https://trigger.macrodroid.com/c306bcd7-5f78-4895-bee4-69600af77d4d/ID?VARNAME1=Hello

To set multiple variables:
https://trigger.macrodroid.com/c306bcd7-5f78-4895-bee4-69600af77d4d/ID?VARNAME1=42&VARNAME2=Hello_World

For Dictionaries / Array:
https://trigger.macrodroid.com/c306bcd7-5f78-4895-bee4-69600af77d4d/ID?DATA(KEY)=VALUETEXT

More information here. https://medium.com/@macrodroid/introducing-the-webhook-trigger-a760e2ee140d

Example Usage
This macro will receive values by webhook and speak them by TTS.

Triggers

Webhook (MyWebhook)
https://trigger.macrodroid.com/c306bcd7-5f78-4895-bee4-69600af77d4d/ID?VARNAME1=Hello


Actions

Speak text: You received a new value [lv=VARNAME1]


Constraints



Local variables

VARNAME1 [Hello] (Type String)