0

Feeds will not show HubSpot Webhooks data
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Feeds will not show HubSpot Webhooks data

by Spencer_Textile on Wed Dec 19, 2018 6:01 pm

I must be doing something incorrectly.

I have copied the webhooks URL from my adafruit.io feed. It's a test feed for a project I have in mind, so if anyone wishes to post to it, you're welcome. I can set up a replacement feed later once I figure out why this isn't working.

https://io.adafruit.com/api/v2/webhooks ... NBeW3u7Eja

I pasted that link into the HubSpot webhooks automation. Nothing. No data will ever appear there.

I pasted a link into the automation from the Webhook Tester site and I can get data to post very reliably from HubSpot to the Webhook Tester.

Do I have to do something to activate the adafruit.io feed?

Spencer_Textile
 
Posts: 7
Joined: Sun Dec 16, 2018 2:57 pm

Re: Feeds will not show HubSpot Webhooks data

by abachman on Thu Dec 20, 2018 6:12 pm

Hi Spencer,


You probably didn't do anything wrong, but we may have built this feature a little different than HubSpot is expecting.

The big thing is that IO is expecting data to come in a POST request (normal webhook stuff) with a parameter named value. You can see the documentation here: https://io.adafruit.com/api/docs/#operation/createWebhookFeedData. That way, any code that was using the normal feed data creation HTTP API endpoint would be able to use the webhook endpoints without changing the data that is sent.

A few questions:

Do you happen to have a sample (redacted is totally fine) of the data HubSpot is sending?

What is your goal with the data? Are you trying to get a single value (number, string, boolean, etc) for an IO dashboard or are you intending to forward all data to a different device or endpoint for processing?

Are you able to configure the HubSpot webhook setup in any way? For example, GitHub allows choosing the event type and the payload Content-Type (application/json vs. application/x-www-form-urlencoded), but not params which means GitHub webhook sending won't work with IO webhook receiving in IO's current form. GitHub's webhook config:

Screen Shot 2018-12-20 at 5.02.32 PM.png
Screen Shot 2018-12-20 at 5.02.32 PM.png (43.8 KiB) Viewed 95 times


Since webhook receivers are a new feature, we're still trying to get a feel for how they can be most useful. Thanks for checking them out!


- Adam B.

abachman
 
Posts: 255
Joined: Mon Feb 01, 2010 12:48 pm

Re: Feeds will not show HubSpot Webhooks data

by Spencer_Textile on Fri Dec 21, 2018 11:08 am

Hi Adam,

Thanks for responding.

Configuration with the HubSpot webhooks functionality appears to be nonexistent. I've attached a screenshot, though, showing that HubSpot is set up in POST format.
Screen Shot 2018-12-21 at 8.26.59 AM.png
The view of the HubSpot workflow programming.
Screen Shot 2018-12-21 at 8.26.59 AM.png (65.24 KiB) Viewed 87 times


And, it is able to post to the Webhook Tester portal. I've attached a redacted snapshot of the test post in that portal. I'll be curious to learn what/how that helps you diagnose. Judging from your comment, and looking at the data in Webhook Tester, it appears that the content type of the feed from HubSpot is JSON...which I think you're saying isn't accepted by io presently.
Screen Shot 2018-12-21 at 8.39.58 AM.png
Here's the Webhook Tester screenshot
Screen Shot 2018-12-21 at 8.39.58 AM.png (165.41 KiB) Viewed 87 times


Regarding my intentions, I'd just like to be able to trigger events (lights/sounds/whatever) in an office based on deals running through HubSpot. I'm set to receive my Huzzah w/ 8266 today. The device will be connected to constant power, so it's not a problem for it to be awake continuously. I'd like it to monitor the .io feed (or any feed), and each time it sees a new post, trigger the sequence in the office. Maybe if I get a lot smarter I might try to pull some kind of data from the feed and display it on a TFT or in a RSS feed to a larger screen or something...but I'm a long way from being that smart.

If webhooks to Ada.io isn't the answer for now...what other mechanisms could be explored? I've tried a Zap, but I'm having a similar befuddling result there. Test Zaps are posting okay, but there's no Zaps hitting the feed from actual hubspot activity. I realize this makes it sound like HubSpot isn't working right, or I'm not programming it correctly....but it's really not a complicated environment, so I don't think that's the case. Plus, it seems to be working to Webhook Tester just fine?

This is not a mission-critical rig, so, if the only way for now is to jump through a couple less-reliable hops to get the effect...that's probably okay.

Any advice you have will surely guarantee you're on Santa's 'nice' list.

Spencer_Textile
 
Posts: 7
Joined: Sun Dec 16, 2018 2:57 pm

Re: Feeds will not show HubSpot Webhooks data

by abachman on Fri Dec 21, 2018 7:22 pm

Spencer,


We've added a feature to the feed webhooks that may help in this situation.

Now, if you add /raw to the end of the webhook URL you got from Adafruit IO, we'll store the whole request contents instead of looking for a parameter named "value". With your HubSpot example (and GitHub and many others) you can't control the payload that the service is publishing, so we'll just store all of it and rebroadcast it like any other published feed value. If you update your existing HubSpot thing and add /raw to the end of the URL, it should show you the data in IO.

The webhook form has been updated with those instructions:
raw-webhook-urls.png
raw-webhook-urls.png (54.21 KiB) Viewed 80 times


If this still gives you trouble, I've got a glitch.com project that receives and displays webhooks (kind of like the tester you're using) and another that publishes to IO. Mash those up and you've got a webhook -> IO back door, but it's probably a lot more trouble than just dropping a URL on HubSpot :P


- adam

abachman
 
Posts: 255
Joined: Mon Feb 01, 2010 12:48 pm

Re: Feeds will not show HubSpot Webhooks data

by Spencer_Textile on Sat Dec 22, 2018 3:00 am

WORKED!!

That's awesome, Adam.

I swear I did not see that /raw option in there before. Is it possible that the feature was added literally since I started this 5 days ago? Or am I just becoming that inattentive in my old age?

Now to move on to the part of the journey where I figure out how to get the Huzzah to monitor that feed and treat that whole string of raw data as a '1', and take action. If you have any links to the best forum posts or tutorials on the subject, I'd be obliged.

You've been a great help.

Thanks so much.

Spencer_Textile
 
Posts: 7
Joined: Sun Dec 16, 2018 2:57 pm

Re: Feeds will not show HubSpot Webhooks data

by abachman on Sat Dec 22, 2018 9:24 am

Yeah, the feature is brand new, I added it yesterday. I suspected we'd need something like it, though.

As far as responding to it, if you know that every message on that channel is a legit notification, then any of the Adafruit IO Arduino example sketches that demonstrate message handlers will work. For example, open up https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/examples/adafruitio_01_subscribe/adafruitio_01_subscribe.ino, and put your code in the handleMessage function and you should be on your way.


- adam b.

abachman
 
Posts: 255
Joined: Mon Feb 01, 2010 12:48 pm

Re: Feeds will not show HubSpot Webhooks data

by Spencer_Textile on Sun Dec 23, 2018 8:26 pm

Screen Shot 2018-12-23 at 5.52.58 PM.png
The Zapier Webhooks Controls
Screen Shot 2018-12-23 at 5.52.58 PM.png (134.88 KiB) Viewed 55 times
Hi again Adam,

Well...if learning painfully is the key to retention...I should be able to remember all this for a while.

For a beginner, the steps to get the Feather Huzzah working (on a Mac) with all the right drivers and libraries has been challenging - but I've finally managed to get the device on wifi, connected to AIO, and interacting with my feeds and dashboards. You guys have done a good job with the documentation, it's just effort for someone with limited experience.

Then I set myself against the task of figuring out how to get the feed to show the right data....and I'VE COME UP WITH A SOLUTION that I thought I might SHARE with you in case others have the problem I did. If you recall we seemingly could only get HubSpot webhooks into AIO with the /raw addition - leaving us with an unwieldy string.

Zapier's webhook setup allows a user to specify a child key from any POST JSON webhook that contains a large payload of pairs. I was able to take the full string from HubSpot that AIO couldn't parse, and run it through Zapier first. Then Zapier pulls the child key I'm interested in and passes it on to AIO. So now I can get the values I really want into my feeds. Have a look at their interface:
Screen Shot 2018-12-23 at 5.52.58 PM.png
The Zapier Webhooks Controls
Screen Shot 2018-12-23 at 5.52.58 PM.png (134.88 KiB) Viewed 55 times


Hopefully this is a tip you can pass along...or possibly build into AIO...for people with similar needs.

If it's not too much trouble, anything else you have on how to read values in a feed and take specific actions (translating them into triggers) I'd be grateful. I know you said to drop my code in the handleMessage section...maybe there's just no shortcuts here and I just need to keep struggling through it, too.

Thanks,

Spencer_Textile
 
Posts: 7
Joined: Sun Dec 16, 2018 2:57 pm

Re: Feeds will not show HubSpot Webhooks data

by Spencer_Textile on Thu Dec 27, 2018 1:00 pm

All set here. I think, with your help, I solved this one. HandleMessage is working.

I don't know if there's a way to mark this topic 'Solved'. I didn't see anything.

Anyway, I'm on to the next step:

https://forums.adafruit.com/viewtopic.php?f=57&t=145475

Thanks!

Spencer_Textile
 
Posts: 7
Joined: Sun Dec 16, 2018 2:57 pm

Please be positive and constructive with your questions and comments.