Receiving a URL with params


#1

1) Give a description of the problem
Is there anyway for webCore to accept a webcall that contains extra params and then set those params to a variable?
Example: sending https://graph-na04-useast2.api.smartthings.com/api/token//execute/&100
And then setting the 100 to a variable for webcore to use:
Example: LEVEL=100

2) What is the expected behavior?
webcore receives the call and assigns it to a variable to be used in the piston

3) What is happening/not happening?
Nothing. I have no Idea how to do this.


#2

I have tried it before if the data passed was json format. I did it in Tasker if I remeber correctly.


#3

I’ve done this with an IFTTT webhooks web request. I configure it to use the POST method w/ content type set to application/json. Then in the body I put something like {“param1” : “value1”, “param2” : “value2”}. (IFTTT’s web request is able to fill in the values with special syntax. So they end up being something like “value1”, etc.) Then in the WC piston, these will show up as $args.param1 & $args.param2.

To be a bit more concrete, here is what it looks like in IFTTT:

image

And in the WC piston I use $args.person & $args.action.

Not sure how this would translate into what you’re using that’s making the web request.

I should also probably mention, the {{ConnectedToOrDisconnectedFrom}} part is what IFTTT fills in when you click on the Add Ingredient button and pick one of the options. This is their special syntax. The curly braces at the start and end of the body is part of the JSON syntax.