Execute piston externally (via webhook) with arguments?


This feels like the wrong place to ask this, because it’s not about design help, but more of a general question. I’m having trouble figuring out how to pass arguments to a piston when executing it via webhook?

Are the arguments passed as part of the URL? Like:
https://[piston url]?arg1="blah"&arg2="blahblah"

Or is it passed in the body as a JSON object?

I found this comment by WCmore:

So it looks like it’s in the URL. But I guess my other question is…

I have a piston who takes in a list of parameters via a JSON object.

So in the receiving piston, it looks like this:


WIth the sending piston looking like this:
[string] args = {"message":"this is a test","messagetypes":"echo,push"}

So I just pas the args variable into the piston when I execute it.

I’m trying to figure out how to perform this external execution via webhook?

So my best guess, is that it would be something like this?

https://[piston url]?args={"message":"this is a test"}

I tried this, but it doesn’t work…so I dunno…


Figured it out…was merely a url encoding issue:

https://[piston url]?args={"message":"this is a test"}

Once encoded into this:
https://[piston url]?args=%7B%22message%22%3A%22this+is+a+test%22%7D

It works great!


I would try something like this:


Alternatively, you can try using ‘+’ instead of ‘%20’:


I purposely didn’t want to go that route because it makes executing that piston from other pistons a PITA because you have to create a variable for each parameter you want to send, and the name of the variable is the name of the argument that gets sent.

So I chose to go this route instead:

The full JSON body is:

    "message":"this is a test",

Now, all I have to do is pass in the JSON object as a single argument. I don’t have to deal with 4 separate variables.

For reference, here’s the greenshot:


For the record, no webCoRE variables are required in my previous post.


If you were executing that piston from another piston, wouldn’t that require having three variables in the piston that is performing the execution? [string] message, [string] messagetype1 and [string] messagetype2?

Unless you are executing pistons from other pistons using the webhook rather than the built in function.


Neither piston needs variables if you use this method:


(although variables would be helpful if you need the data to linger between executions)


Right, that’s what I was saying. You’re executing pistons from other pistons using their webhook, rather than using the built in “Location > Execute Piston” function.

I suppose that’s something I could consider. However, in some areas, I would lose my ability to wait on piston execution completion. But I’m only using that in one piston so far.


Sorry if I was unclear… All of my examples above are using “Make a GET request” as you have done.


When I execute this piston, I just use “Location > Execute Piston” and then I pass in the JSON string as a variable named “args”.

Example usage:

I hadn’t considered executing the piston via “Make GET Request”. I’ll have to look into converting over to that method instead.

The reason I’m trying to ask about the GET request in this post is because I plan on executing the piston from other projects outside of WebCoRE.


I believe that my single line example should also work with the “Execute piston” command.
(although the args are a separate step when using “Execute piston”)

You threw a curve ball though, because you kept mentioning externally via webhook…
(instead of internally via Execute piston)… LOL