Webhooks - Defining the request body as json array?

Hey @dreamnid sorry I didn’t find this message until now! I’m one of the founders of Initial State, and I’ve actually done this before!

The webhook api from particle doesn’t seem to handle json arrays like you’d expect, as you’ve found, so I made the api flexible to accept a single data point via just a root json object instead, example using your data:

{
    "eventName": "tempF",
    "url": "https://groker.initialstate.com/api/events",
    "requestType": "POST",
    "json": {
        "key": "{{SPARK_CORE_ID}}_tempF",
        "value": "{{tempF}}"
    },
    "mydevices": true
}

obviously, this is a little less ideal because you can’t send multiple values at once, but hopefully particle will support proper json arrays soon!

1 Like