Webhook template issues with {{SPARK_CORE_ID}}

I seem to be having this strange issue that webhook templates aren’t replacing {{SPARK_CORE_ID}} and {{SPARK_EVENT_VALUE}} with the actual spark id and event value.

I’ve made this kind of a template.

{
    "event": "webhook-test",
    "url": "http://requestb.in/umx0huum",
    "requestType": "POST",
    "json": {
    	"deviceId": "{{SPARK_CORE_ID}}",
    	"data": "{{SPARK_EVENT_VALUE}}"
    },
    "mydevices": true
}

However, the actual request that I get still has {{SPARK_CORE_ID}} and {{SPARK_EVENT_VALUE}} in it. This is a screenshot of it.

This happens if I put the variable in the url path too. However, the default template with application/x-www-form-urlencoded content type does have the actual spark core id and event data in it.

Am I making some gross mistake in the webhook template? If not, does anyone else have the same issue.

P.S. I updated particle-cli today and the issue persists.

I figured out the problem. Turns out, I hadn’t escaped a newline character in the event value string.

1 Like