Webhook Creation Questions

I have a few questions about how webhooks are being created on the Particle dashboard.

  1. At the top of the New Webhook page are icons for Webhook Builder and Custom JSON. If I enter, say, Event Name and URL in Webhook Builder and then switch over to Custom JSON, those entries do not show up in the Custom JSON, and vice-versa (if I enter “event”:“Try This Now” and switch over to Webhook Builder, the Event Name field is still blank). So what exactly is the relationship between the two? And is there a list somewhere of exactly what fields can go in the Custom JSON?

  2. In connecting to ThingSpeak, under Advanced Settings I was able to send custom data using both the Form and with JSON, entering “api_key”:“my_api_key” and “field1”:"{{PARTICLE_EVENT_VALUE}}", so which should I use and why?

  3. I read over a tutorial that a user had written on the Webhook Responses, and sorta, kinda understood it – but there seems to be very little in the documentation about it. Is there any other source, or are there any plans to expand that section? Needless to say, I am in favor of the latter :smile:

  4. Is it possible to edit a Webhook once it has been created?

  5. Is it is possible to see the web service request (in raw HTTP) that is going to be sent to the web service?

Sorry to be so long winded, but as you can tell I am somewhat at sea with regards to this: I think the abstraction of detail is actually hurting rather than helping (at least for me, in this one particular area).

In an odd coincidence I just (2 hours ago) posted a tutorial that should answer #1, maybe #3, and #5. Hopefully it will be helpful to you.

2 Likes

This tutorial is awesome, exactly what I needed! Thank you so much for putting it together: it would be nice to see it (or at least aspects of it, I don’t want to dictate to Particle.io) included in the official documentation, in some form.

1 Like

Just to clarify this part:

The template below is not valid. Even if the event value is a number once the substition is complete, and would be valid then, you still cannot do this because the template itself is not valid JSON before substitution. Don't do this:

"json": {
    "value": {{PARTICLE_EVENT_VALUE}}
},

all you'd have to do to fix this is put " " around the {{PARTICLE_EVENT_VALUE}}, correct? It wouldn't be a number, but you could parse it... It might be worth mentioning that in the tutorial (eh, assuming that it's correct :smile:

Correct, it needs to be "value": "{{PARTICLE_EVENT_VALUE}}". I can make that clearer.

Hello, for thingspeak in webhook builder can I use field2? or I want to make another webhook?

or using JASON for publishing at the same time?