Webhook json integer values

I am trying to use a webhook to send data to keen.io

{
"eventName": "librato_",
"url": "https://metrics-api.librato.com/v1/metrics",
"requestType": "POST",
"auth": {
    "username": "YOUR_LIBRATO_USERNAME",
    "password": "YOUR_LIBRATO_ACCESS_TOKEN"
},
"json": {
    "gauges": [
        {
            "name": "{{SPARK_EVENT_NAME}}",
            "value": "{{SPARK_EVENT_VALUE}}",
            "source": "{{SPARK_CORE_ID}}"
        }
    ]
},
"mydevices": true
}

Problem is that I cant define an integer. If i remove “” then json format is invalid.

"value": {{SPARK_EVENT_VALUE}} <- invalid json

To support int’s template tags should be different (curly braces aren’t the best choice for json)

"value": ##SPARK_EVENT_VALUE##

Is there any other solution that supports sending ints with webhook?

I’m curious if anyone knows if this issue has been resolved? I have an API I can’t control and is expecting Particle to send JSON integer and decimal values NOT quoted. I don’t see a way to do this today as it won’t let me define my variables not quoted when I create my webhook. Am I missing something?

1 Like

It’s now possible to use the Console to define hooks with integers values. See Console webhook editor improvements

Under the covers, it send the json property as a string. As long as after replacing {{PARTICLE_EVENT_VALUE}} and other variables the string ends up being valid JSON it will work.