Syntax for sending webhook variables from CLI

Hello @Dave, easy question.

I have a webhook that takes a variable as an input:

{
	"eventName": "get_weather",
	"url": "http://api.openweathermap.org/data/2.5/weather",
	"requestType": "GET",	
	"query": {
		"q": "{{location}}",
		"units": "imperial",
	},
	"mydevices": true
}

What is the correct syntax to pass a location to that webhook variable from the CLI?

I tried this but it doesn’t work:

particle publish get_weather "location:Chicago,US"

I’m probably missing some escape characters to send " " properly but can’t figure it out.

Thanks!

PS: I’m using Windows

Hi @sazp96,

Good question! The hook is looking for the event body to be JSON, so something like:

 particle publish get_weather "{\"location\":\"Chicago,US\"}"

Thanks!
David

1 Like

It works! Thanks Dave!

1 Like