Pass Arguments via URL - What is the formatting?


#1

1) Give a description of the problem
I want to pass an argument via a URL to a Piston. What is the format needed of the URL? I want to do a one-liner in Python (just using urlopen) to pass an argument for my Google Home Speaker to speak via cast-web. I am using an AI to detect the color, make and model of a car in my driveway, and would like it to speak that string from my python script.

2) What is the expected behaviour?
The argument added to the end of the URL such as:
https://graph.api.smartthings.com/api/token/HIDDEN/smartapps/installations/HIDDEN/execute/:HIDDEN/?somevariable=“value”

I don’t know how to format it. Do I have to define the argument as a variable in the Piston? Or does whatever gets passed automatically become an $arg.whatevergetsputintheURL

3) What is happening/not happening?
Nothing is happening.

**4) Post a Green Snapshot of the piston!

N/A

5) Attach logs after turning logging level to Full
N/A

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

From your example above, you’ll get value from $args.somevariable


#3

I thought so, however it remains null.

I get a {“result”:“OK”,…

but arguments are null. And there is no sign of any argument being stored in the debug logs


#4

image

from a test piston…
...7ca3373f5:/?device=deviceName&status=unknown

output…

7/12/2019, 11:01:13 AM +650ms
+96ms	║Data: deviceName
+105ms	║Data: unknown

#5

Thanks.

Maybe I was looking in the wrong place. It turns out the above was the correct formatting/syntax.

I just didn’t see any indication it was stored. I got it now.


#6

Args don’t linger. They only appear briefly at the moment of execution. If you need storage options, then you can place the args into a local variable, and it will be captured when the piston runs next.