Help creating a webhook needed!

I am trying to make a webhook to effectively visit my selected URL. My url is something like :
I would like my webhook to create visit a URL that looks like this{variable}&winddir={variable}&windspeedmph={variable}… And so on with around 15 things formatted as “&someparameter=” followed by a variable from my photon. I want this URL to be “visited” like it was typed into the box at the top of a web browser. PLEASE HELP! I am very new to webhooks and I need help

1 Like

If you just need to “ping” a URL, create a webhook that performs a GET request to the complete URL you posted.

The problem I have is that I need ability for the variables to change. I think that requires a query but I don’t know how to set one up like this.

If you use {{SPARK_EVENT_VALUE}} in your URL, the webhook will replace it with the data string sent in the Particle Publish calling the webhook.

I apologize but I am not quite sure what you mean by that

I mean doing something like:{{SPARK_EVENT_VALUE}}

As your URL.

You would make your device generate the string of additional arguments that would need to change and publish them with the webhook call.

Note, the data string in a publish is limited to 64 characters.

Can I do multiple variables with multiple different strings of text leading up to each using this method?

Yes, you can concatenate strings together to produce the final string to send.

Can I use a query in my Webhook and then use an array with each of my text strings that precede the variables assigned to a different variable in my array?

Yes you can.

Just make sure you are sending one final concatenated string in the publish and that it is 64 characters or less.

Nope, it’s limited to 255 characters.

Sorry for the misinformation, I answered this question hastily without checking the docs.

1 Like

I think he’s asking a slightly different question - but I could be wrong. I think he’s asking whether he can publish a string with multiple values or multiple strings, and have the webhook somehow parse those values and place them into the correct spots in the final string. Something like this perhaps:{{SPARK_EVENT_VALUE1}}&wind_dir={{SPARK_EVENT_VALUE2}}

So this may not be what bmwagner is asking, but I’d like to know anyway. This would be perfect for me, but I’m pretty sure it’s not possible - right?

This might be what you want to read

1 Like

Yes, what ScruffR said. You can put the custom mustache variables in the URL, query fields, and body of the webhook. This is my tutorial on the topic.

1 Like

Thank you both so much. I think that’s exactly what I need. I haven’t yet looked at the tutorial (will in just a moment). But I assume this can be done in forming an HTTP GET request - yes?

Yes, it works for GET in the URL or query parameters. Of course it also works for POST in the body as well.

Yup - I’m just going through your tutorial. Thanks again!