Webhook integration with heroku

Hi. We have a django site hosted on on heroku. We made an endpoint

/events/<device_id>

set up a webhook integration called tracking_event w the following form data

{
  "event": "{{{PARTICLE_EVENT_NAME}}}",
  "data": "{{{PARTICLE_EVENT_VALUE}}}",
  "coreid": "{{{PARTICLE_DEVICE_ID}}}",
  "published_at": "{{{PARTICLE_PUBLISHED_AT}}}"
}

Hitting ‘test integration’ button publishes to our endpoint on heroku. My heroku logs of request.POST look like:

2020-09-25T21:58:19.955482+00:00 app[web.1]: [25/Sep/2020 21:58:19,955] 
<QueryDict: {
'event': ['tracking_event'], 
'data': ['test-event'], 
'published_at': ['2020-09-25T21:58:19.698Z'], 
'coreid': ['api']}>
2020-09-25T21:58:19.957044+00:00 app[web.1]: 10.45.161.126 - - [25/Sep/2020:21:58:19 +0000] "POST /events/api HTTP/1.1" 200 12 "-" "ParticleBot/1.1 (https://docs.particle.io/webhooks)"

I added the code that it says to add to firmware (setup, callback and publish) without changing anything. But I am not getting published events from firmwear to hit that heroku endpoint. Any idea what else needs to be done?

Sorry for noob question

Have you had a look at the webhook stats at the bottom of the page console.particle.io/integrations/?
What does it tell you there?
Can you see the outgoing even that should trigger the webhook in console.particle.io/logs?
Is your webhook actually subscribed to tracking_event?
Can you share the exact code that you copied into your project?
Have you maybe set a device filter in the webhook?

With only partial info it’s difficult to assess the issue.

We got it working. We removed the call to the handler function. Then hit “test” again. I’m not sure which one of those fixed it. But thank you for taking the time to answer.

I can see those, but we were checking heroku logs to see if endpoint was being hit.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.