558afe7f04 | ||
---|---|---|
.. | ||
README.md | ||
particle_webhooks.go | ||
particle_webhooks_mocks.go | ||
particle_webhooks_models.go | ||
particle_webhooks_test.go |
README.md
Particle Webhook
Particle Webhook Plug-in for Telegraf
Particle events can be sent to Webhooks. Webhooks are configured using Integrations. Assuming your Particle publishes an event called MY_EVENT, you could configure an Integration with:
- "Event Name" set to MY_EVENT
- "URL" set to http://MY_IP:1619/particle
- Leave "Request Type" set to "POST"
- Leave "Device" set to "Any"
Replace MY_EVENT and MY_IP appropriately.
Then click "Create Webhook".
You may watch the stream of Particle events including the hook-sent/MY_EVENT and hook-response/MY_EVENT entries in the Logs
Particle
See Particle Webhooks documentation.
The default data is:
{
"event": MY_EVENT,
"data": MY_EVENT_DATA,
"published_at": MY_EVENT_TIMESTAMP,
"coreid": DEVICE_ID
}
The following Particle (trivial) sample publishes a random number as an event called "randomnumber" every 10 seconds:
void loop() {
Particle.publish("randomnumber", String(random(1000)), PRIVATE);
delay(10000);
}
Events
Tags:
- 'event' =
event
string - 'coreid' =
coreid
string
Fields:
- 'data' =
data
int
Time:
- 'published' =
published_at
time.Time (ISO-8601)