How to have end user change a webhook url without signing into the console?

For instance I want the user to be able to select the closest Wunderground location, and then have the data accessible for that region. I can do this just fine by creating a custom webhook through the particle console, but what would be nice is for the user to be able to copy and paste the api address and the webhook automatically changed.
What is the best method for this?

you can set the location city and state with a Particle.function()

then use that to Particle.publish() a call to a webhook that uses that information:

char requestString[64] = "";
snprintf(requestString, sizeof(requestString), "{\"my-city\":\"%s\",\"my-state\":\"%s\"}",, userSpecificData.stateAbbr);
Particle.publish("Current_Weather", requestString, PRIVATE);

set up your url in your integration to use the arguments:{{my-state}}/{{my-city}}.json

and create your own response template, like this:



Thats very helpful, thanks I will try it out!